From 69de2f4a8a7c02e4301c710a1b756057a0817070 Mon Sep 17 00:00:00 2001 From: mattamon Date: Mon, 15 Apr 2024 08:34:54 +0200 Subject: [PATCH] Add OpenApiServiceTest --- .../Service/OpenApi/OpenApiServiceTest.php | 52 +++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 tests/Unit/Service/OpenApi/OpenApiServiceTest.php diff --git a/tests/Unit/Service/OpenApi/OpenApiServiceTest.php b/tests/Unit/Service/OpenApi/OpenApiServiceTest.php new file mode 100644 index 000000000..56c4b2b51 --- /dev/null +++ b/tests/Unit/Service/OpenApi/OpenApiServiceTest.php @@ -0,0 +1,52 @@ +getConfig(); + + $this->assertSame('3.0.0', $config->openapi); + } + + public function getConfigTestWithCustomPaths(): void + { + $openApiService = new OpenApiService([ + 'src/Util/', + ]); + $config = $openApiService->getConfig(); + + $this->assertSame('3.0.0', $config->openapi); + } + + public function getConfigTestWithCustomPathsException(): void + { + $openApiService = new OpenApiService([ + 'testPath', + ]); + + $this->expectException(ErrorException::class); + $openApiService->getConfig(); + } +} \ No newline at end of file