From e722f642adb63cc46e01a8caac807ec5a2a903d8 Mon Sep 17 00:00:00 2001 From: Guilhem Niot Date: Mon, 21 Mar 2022 17:03:16 +0100 Subject: [PATCH 1/2] Fix the tests --- Tests/Functional/Controller/ApiController80.php | 3 ++- Tests/Functional/FunctionalTest.php | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Tests/Functional/Controller/ApiController80.php b/Tests/Functional/Controller/ApiController80.php index 6e4842b..b292e83 100644 --- a/Tests/Functional/Controller/ApiController80.php +++ b/Tests/Functional/Controller/ApiController80.php @@ -252,7 +252,8 @@ class ApiController80 /** * @Route("/custom-operation-id", methods={"GET", "POST"}) * - * @Operation(operationId="custom-operation-id") + * @OA\Get(operationId="get-custom-operation-id") + * @OA\Post(operationId="post-custom-operation-id") * @OA\Response(response=200, description="success") */ public function customOperationIdAction() diff --git a/Tests/Functional/FunctionalTest.php b/Tests/Functional/FunctionalTest.php index fb3bd67..e70cbb2 100644 --- a/Tests/Functional/FunctionalTest.php +++ b/Tests/Functional/FunctionalTest.php @@ -564,10 +564,10 @@ class FunctionalTest extends WebTestCase public function testCustomOperationId() { $operation = $this->getOperation('/api/custom-operation-id', 'get'); - $this->assertEquals('custom-operation-id', $operation->operationId); + $this->assertEquals('get-custom-operation-id', $operation->operationId); $operation = $this->getOperation('/api/custom-operation-id', 'post'); - $this->assertEquals('custom-operation-id', $operation->operationId); + $this->assertEquals('post-custom-operation-id', $operation->operationId); } /** From a39317726a40103249eafc8bf41b2ce99135ff14 Mon Sep 17 00:00:00 2001 From: Guilhem Niot Date: Mon, 21 Mar 2022 17:04:37 +0100 Subject: [PATCH 2/2] CS --- Util/SetsContextTrait.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Util/SetsContextTrait.php b/Util/SetsContextTrait.php index 497b5c8..bf6cba5 100644 --- a/Util/SetsContextTrait.php +++ b/Util/SetsContextTrait.php @@ -15,7 +15,7 @@ trait SetsContextTrait // zircote/swagger-php ^3.2 \OpenApi\Analyser::$context = $context; } else { - /// zircote/swagger-php ^4.0 + // zircote/swagger-php ^4.0 \OpenApi\Generator::$context = $context; } }