OXIESEC PANEL
- Current Dir:
/
/
var
/
www
/
reader
/
API
/
vendor
/
zircote
/
swagger-php
/
tests
/
Processors
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
08/07/2024 04:34:33 AM
rwxr-xr-x
📄
AugmentParametersTest.php
1.76 KB
08/07/2024 04:34:32 AM
rw-r--r--
📄
AugmentPropertiesTest.php
11.86 KB
08/07/2024 04:34:32 AM
rw-r--r--
📄
AugmentRefsTest.php
1.17 KB
08/07/2024 04:34:32 AM
rw-r--r--
📄
AugmentRequestBodyTest.php
1.09 KB
08/07/2024 04:34:32 AM
rw-r--r--
📄
AugmentSchemasTest.php
2.18 KB
08/07/2024 04:34:32 AM
rw-r--r--
📄
BuildPathsTest.php
1.86 KB
08/07/2024 04:34:32 AM
rw-r--r--
📄
CleanUnmergedTest.php
2.89 KB
08/07/2024 04:34:33 AM
rw-r--r--
📄
CleanUnusedComponentsTest.php
1.22 KB
08/07/2024 04:34:33 AM
rw-r--r--
📄
DocBlockDescriptionsTest.php
3.74 KB
08/07/2024 04:34:33 AM
rw-r--r--
📄
ExpandClassesTest.php
8.86 KB
08/07/2024 04:34:33 AM
rw-r--r--
📄
ExpandEnumsTest.php
6.13 KB
08/07/2024 04:34:33 AM
rw-r--r--
📄
MergeIntoComponentsTest.php
1 KB
08/07/2024 04:34:33 AM
rw-r--r--
📄
MergeIntoOpenApiTest.php
1007 bytes
08/07/2024 04:34:33 AM
rw-r--r--
📄
MergeJsonContentTest.php
4.2 KB
08/07/2024 04:34:33 AM
rw-r--r--
📄
MergeXmlContentTest.php
4.13 KB
08/07/2024 04:34:33 AM
rw-r--r--
📄
OperationIdTest.php
1.57 KB
08/07/2024 04:34:33 AM
rw-r--r--
Editing: BuildPathsTest.php
Close
<?php declare(strict_types=1); /** * @license Apache 2.0 */ namespace OpenApi\Tests\Processors; use OpenApi\Analysis; use OpenApi\Annotations as OA; use OpenApi\Generator; use OpenApi\Processors\BuildPaths; use OpenApi\Processors\MergeIntoOpenApi; use OpenApi\Tests\OpenApiTestCase; class BuildPathsTest extends OpenApiTestCase { public function testMergePathsWithSamePath(): void { $openapi = new OA\OpenApi(['_context' => $this->getContext()]); $openapi->paths = [ new OA\PathItem(['path' => '/comments', '_context' => $this->getContext()]), new OA\PathItem(['path' => '/comments', '_context' => $this->getContext()]), ]; $analysis = new Analysis([$openapi], $this->getContext()); $analysis->openapi = $openapi; $analysis->process([new BuildPaths()]); $this->assertCount(1, $openapi->paths); $this->assertSame('/comments', $openapi->paths[0]->path); } public function testMergeOperationsWithSamePath(): void { $openapi = new OA\OpenApi(['_context' => $this->getContext()]); $analysis = new Analysis( [ $openapi, new OA\Get(['path' => '/comments', '_context' => $this->getContext()]), new OA\Post(['path' => '/comments', '_context' => $this->getContext()]), ], $this->getContext() ); $analysis->process([ new MergeIntoOpenApi(), new BuildPaths(), ]); $this->assertCount(1, $openapi->paths); $path = $openapi->paths[0]; $this->assertSame('/comments', $path->path); $this->assertInstanceOf(OA\PathItem::class, $path); $this->assertInstanceOf(OA\Get::class, $path->get); $this->assertInstanceOf(OA\Post::class, $path->post); $this->assertSame(Generator::UNDEFINED, $path->put); } }