From da111f90d7e575a7c28a4720aef29bddef002957 Mon Sep 17 00:00:00 2001 From: Koen Eelen Date: Thu, 7 Mar 2024 11:07:39 +0100 Subject: [PATCH] Fix broken phpstan test --- .../Infrastructure/Service/LoginAuth0AdapterTest.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tests/Infrastructure/Service/LoginAuth0AdapterTest.php b/tests/Infrastructure/Service/LoginAuth0AdapterTest.php index 39a03a2..ec277d6 100644 --- a/tests/Infrastructure/Service/LoginAuth0AdapterTest.php +++ b/tests/Infrastructure/Service/LoginAuth0AdapterTest.php @@ -9,6 +9,7 @@ use Auth0\SDK\Exception\CoreException; use CultuurNet\UDB3\JwtProvider\Domain\Enum\Locale; use CultuurNet\UDB3\JwtProvider\Domain\Exception\UnSuccessfulAuthException; +use Exception; use PHPUnit\Framework\TestCase; final class LoginAuth0AdapterTest extends TestCase @@ -77,7 +78,7 @@ public function it_returns_refresh_token(): void * @throws CoreException * @throws UnSuccessfulAuthException */ - public function it_wraps_auth0_exceptions_to_unsuccessful_auth_exception(string $exceptionClassName): void + public function it_wraps_auth0_exceptions_to_unsuccessful_auth_exception(Exception $exceptionClass): void { $auth0 = $this->prophesize(Auth0::class); @@ -85,7 +86,7 @@ public function it_wraps_auth0_exceptions_to_unsuccessful_auth_exception(string $auth0->reveal() ); - $auth0->getIdToken()->willThrow($exceptionClassName); + $auth0->getIdToken()->willThrow($exceptionClass); $this->expectException(UnSuccessfulAuthException::class); @@ -93,13 +94,13 @@ public function it_wraps_auth0_exceptions_to_unsuccessful_auth_exception(string } /** - * @return string[][] + * @return Exception[][] */ public function auth0_exceptions(): array { return [ - [ApiException::class], - [CoreException::class], + [new ApiException()], + [new CoreException()], ]; } }