Skip to content

Commit

Permalink
Fix broken phpstan test
Browse files Browse the repository at this point in the history
  • Loading branch information
Koen Eelen committed Mar 7, 2024
1 parent 1ced4f6 commit da111f9
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions tests/Infrastructure/Service/LoginAuth0AdapterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -77,29 +78,29 @@ 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);

$auth0adapter = new LoginAuth0Adapter(
$auth0->reveal()
);

$auth0->getIdToken()->willThrow($exceptionClassName);
$auth0->getIdToken()->willThrow($exceptionClass);

$this->expectException(UnSuccessfulAuthException::class);

$auth0adapter->token();
}

/**
* @return string[][]
* @return Exception[][]
*/
public function auth0_exceptions(): array
{
return [
[ApiException::class],
[CoreException::class],
[new ApiException()],
[new CoreException()],
];
}
}

0 comments on commit da111f9

Please sign in to comment.