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: AugmentSchemasTest.php
Close
<?php declare(strict_types=1); /** * @license Apache 2.0 */ namespace OpenApi\Tests\Processors; use OpenApi\Generator; use OpenApi\Processors\AugmentSchemas; use OpenApi\Processors\MergeIntoComponents; use OpenApi\Processors\MergeIntoOpenApi; use OpenApi\Tests\OpenApiTestCase; class AugmentSchemasTest extends OpenApiTestCase { public function testAugmentSchemas(): void { $analysis = $this->analysisFromFixtures(['Customer.php']); $analysis->process([ // create openapi->components new MergeIntoOpenApi(), // Merge standalone Scheme's into openapi->components new MergeIntoComponents(), ]); $this->assertCount(1, $analysis->openapi->components->schemas); $customer = $analysis->openapi->components->schemas[0]; $this->assertSame(Generator::UNDEFINED, $customer->schema, 'Sanity check. No scheme was defined'); $this->assertSame(Generator::UNDEFINED, $customer->properties, 'Sanity check. @OA\Property\'s not yet merged '); $analysis->process([new AugmentSchemas()]); $this->assertSame('Customer', $customer->schema, '@OA\Schema()->schema based on classname'); $this->assertIsArray($customer->properties); $this->assertCount(10, $customer->properties, '@OA\Property()s are merged into the @OA\Schema of the class'); } public function testAugmentSchemasForInterface(): void { $analysis = $this->analysisFromFixtures(['CustomerInterface.php']); $analysis->process([ // create openapi->components new MergeIntoOpenApi(), // Merge standalone Scheme's into openapi->components new MergeIntoComponents(), ]); $this->assertCount(1, $analysis->openapi->components->schemas); $customer = $analysis->openapi->components->schemas[0]; $this->assertSame(Generator::UNDEFINED, $customer->properties, 'Sanity check. @OA\Property\'s not yet merged '); $analysis->process([new AugmentSchemas()]); $this->assertIsArray($customer->properties); $this->assertCount(9, $customer->properties, '@OA\Property()s are merged into the @OA\Schema of the class'); } }