From 40b23c1e31ee63c9912b03309522262c8c3df41a Mon Sep 17 00:00:00 2001 From: Robin Chalas Date: Wed, 3 Jul 2024 23:05:53 +0200 Subject: [PATCH] fix CI --- Tests/Functional/AppKernel.php | 1 + .../Command/ApiPlatformOpenApiExportCommandTest.php | 3 +-- Tests/Functional/WebTokenTest.php | 7 ++++--- Tests/Functional/config/base_config.yml | 3 +++ composer.json | 1 + 5 files changed, 10 insertions(+), 5 deletions(-) diff --git a/Tests/Functional/AppKernel.php b/Tests/Functional/AppKernel.php index aaec8485..6bddcfd7 100644 --- a/Tests/Functional/AppKernel.php +++ b/Tests/Functional/AppKernel.php @@ -105,6 +105,7 @@ public function registerContainerConfiguration(LoaderInterface $loader): void 'description' => 'API Platform integration in LexikJWTAuthenticationBundle', 'version' => '1.0.0', 'keep_legacy_inflector' => false, + 'use_symfony_listeners' => true, 'formats' => [ 'jsonld' => ['application/ld+json'], 'json' => ['application/json'] diff --git a/Tests/Functional/Command/ApiPlatformOpenApiExportCommandTest.php b/Tests/Functional/Command/ApiPlatformOpenApiExportCommandTest.php index 54439a04..c7e2d228 100644 --- a/Tests/Functional/Command/ApiPlatformOpenApiExportCommandTest.php +++ b/Tests/Functional/Command/ApiPlatformOpenApiExportCommandTest.php @@ -107,8 +107,7 @@ public function testCheckOpenApiExportCommand() "tags": [ "Login Check" ] - }, - "parameters": [] + } } }, "components": { diff --git a/Tests/Functional/WebTokenTest.php b/Tests/Functional/WebTokenTest.php index 33c0a2e6..55effdf0 100644 --- a/Tests/Functional/WebTokenTest.php +++ b/Tests/Functional/WebTokenTest.php @@ -2,6 +2,7 @@ namespace Lexik\Bundle\JWTAuthenticationBundle\Tests\Functional; +use Symfony\Component\HttpFoundation\Request; use Jose\Component\Core\AlgorithmManager; use Jose\Component\Core\JWK; use Jose\Component\Encryption\Algorithm\ContentEncryption\A128GCM; @@ -76,7 +77,7 @@ public function testAnAccessTokenCanBeUsedForApiCall() //When static::$client->jsonRequest('POST', '/login_check', ['username' => 'lexik', 'password' => 'dummy']); - static::$client->request('GET', '/api/secured', [], [], ['HTTP_AUTHORIZATION' => 'Bearer ' . $this->getTokenFromResponse(static::$client->getResponse())]); + static::$client->request(Request::METHOD_GET, '/api/secured', [], [], ['HTTP_AUTHORIZATION' => 'Bearer ' . $this->getTokenFromResponse(static::$client->getResponse())]); static::$client->getResponse(); //Then @@ -103,7 +104,7 @@ public function testInvalidToken(string $token, string $message) }); //When - static::$client->request('GET', '/api/secured', [], [], ['HTTP_AUTHORIZATION' => 'Bearer ' . $token]); + static::$client->request(Request::METHOD_GET, '/api/secured', [], [], ['HTTP_AUTHORIZATION' => 'Bearer ' . $token]); $response = static::$client->getResponse(); //Then @@ -137,7 +138,7 @@ public function testCriticalHeaderNotVerified() ); //When - static::$client->request('GET', '/api/secured', [], [], ['HTTP_AUTHORIZATION' => 'Bearer ' . $token]); + static::$client->request(Request::METHOD_GET, '/api/secured', [], [], ['HTTP_AUTHORIZATION' => 'Bearer ' . $token]); $response = static::$client->getResponse(); //Then diff --git a/Tests/Functional/config/base_config.yml b/Tests/Functional/config/base_config.yml index 70e12e30..6a89db99 100644 --- a/Tests/Functional/config/base_config.yml +++ b/Tests/Functional/config/base_config.yml @@ -2,6 +2,9 @@ framework: secret: test test: ~ http_method_override: false + handle_all_throwables: true + php_errors: + log: true services: lexik_jwt_authentication.test.jwt_event_subscriber: diff --git a/composer.json b/composer.json index 84fc87e5..0da8a1a9 100644 --- a/composer.json +++ b/composer.json @@ -53,6 +53,7 @@ }, "require-dev": { "api-platform/core": "^3.0", + "rector/rector": "^1.2", "symfony/browser-kit": "^6.4|^7.0", "symfony/console": "^6.4|^7.0", "symfony/dom-crawler": "^6.4|^7.0",