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: AugmentParametersTest.php
Close
<?php declare(strict_types=1); /** * @license Apache 2.0 */ namespace OpenApi\Tests\Processors; use OpenApi\Generator; use OpenApi\Processors\Concerns\DocblockTrait; use OpenApi\Tests\OpenApiTestCase; class AugmentParametersTest extends OpenApiTestCase { use DocblockTrait; public function testAugmentParameter(): void { $openapi = (new Generator()) ->setAnalyser($this->getAnalyzer()) ->generate([$this->fixture('UsingRefs.php')]); $this->assertCount(1, $openapi->components->parameters, 'OpenApi contains 1 reusable parameter specification'); $this->assertEquals('ItemName', $openapi->components->parameters[0]->parameter, 'When no @OA\Parameter()->parameter is specified, use @OA\Parameter()->name'); } public static function tagCases(): iterable { yield 'complete' => [ '@param string $foo The foo parameter.', ['param' => ['foo' => ['type' => 'string', 'description' => 'The foo parameter.']]], ]; yield 'no-description' => [ '@param string $foo', ['param' => ['foo' => ['type' => 'string', 'description' => null]]], ]; yield 'no-type' => [ '@param $foo The description', ['param' => ['foo' => ['type' => null, 'description' => 'The description']]], ]; yield 'no-var' => [ '@param foo The description', ['param' => []], ]; } /** * @dataProvider tagCases */ public function testExtractTags(string $params, array $expected): void { $mixed = $this->getContext(['comment' => "/**\n$params\n *"]); $tags = []; $this->extractContent($mixed->comment, $tags); $this->assertEquals($expected, $tags); } }