From 3fce8f9dbc8530e186e9155199097a9be222b657 Mon Sep 17 00:00:00 2001 From: Konstantin Lapkovsky Date: Wed, 13 Dec 2023 20:14:20 +0400 Subject: [PATCH] test: add test case. --- tests/SwaggerServiceTest.php | 9 +++++++ ...mp_data_request_with_empty_data_query.json | 24 +++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 tests/fixtures/SwaggerServiceTest/tmp_data_request_with_empty_data_query.json diff --git a/tests/SwaggerServiceTest.php b/tests/SwaggerServiceTest.php index 47cde25..1aca0e6 100644 --- a/tests/SwaggerServiceTest.php +++ b/tests/SwaggerServiceTest.php @@ -327,6 +327,10 @@ public static function getAddEmptyData(): array 'security' => 'jwt', 'savedTmpDataFixture' => 'tmp_data_request_with_empty_data_jwt', ], + [ + 'security' => 'query', + 'savedTmpDataFixture' => 'tmp_data_request_with_empty_data_query', + ], ]; } @@ -345,6 +349,11 @@ public function testAddDataRequestWithEmptyDataLaravel(string $security, string 'name' => 'Authorization', 'in' => 'header', 'type' => 'apiKey' + ], + 'query' => [ + 'name' => 'api_key', + 'in' => 'query', + 'type' => 'apiKey' ] ] ]); diff --git a/tests/fixtures/SwaggerServiceTest/tmp_data_request_with_empty_data_query.json b/tests/fixtures/SwaggerServiceTest/tmp_data_request_with_empty_data_query.json new file mode 100644 index 0000000..1e65a0d --- /dev/null +++ b/tests/fixtures/SwaggerServiceTest/tmp_data_request_with_empty_data_query.json @@ -0,0 +1,24 @@ +{ + "swagger": "2.0", + "host": "localhost", + "basePath": "\/", + "schemes": [], + "paths": [], + "definitions": [], + "info": { + "description": "This is automatically collected documentation", + "version": "0.0.0", + "title": "Name of Your Application", + "termsOfService": "", + "contact": { + "email": "your@mail.com" + } + }, + "securityDefinitions": { + "query": { + "type": "apiKey", + "name": "api_key", + "in": "query" + } + } +} \ No newline at end of file