From f5346d6947f18ca606e9e73986a5abb28be4d3e8 Mon Sep 17 00:00:00 2001 From: ldaspt Date: Thu, 9 Nov 2023 16:32:10 +0100 Subject: [PATCH] Try to fix TU --- EventListener/BlockJWTListener.php | 4 ++-- .../Command/ApiPlatformOpenApiExportCommandTest.php | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/EventListener/BlockJWTListener.php b/EventListener/BlockJWTListener.php index d1df45df..6c327a1a 100644 --- a/EventListener/BlockJWTListener.php +++ b/EventListener/BlockJWTListener.php @@ -45,14 +45,14 @@ private function blockTokenFromRequest(Request $request): void try { $payload = $this->jwtManager->parse($token); - } catch (JWTDecodeFailureException) { + } catch (JWTDecodeFailureException $e) { // Ignore decode failures, this would mean the token is invalid anyway return; } try { $this->tokenManager->add($payload); - } catch (MissingClaimException) { + } catch (MissingClaimException $e) { // We can't block a token missing the claims our system requires, so silently ignore this one } } diff --git a/Tests/Functional/Command/ApiPlatformOpenApiExportCommandTest.php b/Tests/Functional/Command/ApiPlatformOpenApiExportCommandTest.php index f4194bb6..8a655a42 100644 --- a/Tests/Functional/Command/ApiPlatformOpenApiExportCommandTest.php +++ b/Tests/Functional/Command/ApiPlatformOpenApiExportCommandTest.php @@ -2,6 +2,7 @@ namespace Lexik\Bundle\JWTAuthenticationBundle\Tests\Functional\Command; +use ApiPlatform\OpenApi\OpenApi; use Lexik\Bundle\JWTAuthenticationBundle\Tests\Functional\TestCase; use Symfony\Bundle\FrameworkBundle\Console\Application; use Symfony\Component\Console\Tester\CommandTester; @@ -25,9 +26,10 @@ public function testCheckOpenApiExportCommand() $tester = new CommandTester($app->find('api:openapi:export')); $this->assertSame(0, $tester->execute([])); + $openApiVersion = class_exists(OpenApi::class) ? OpenApi::VERSION : '3.0.0'; $this->assertJsonStringEqualsJsonString(<<