OXIESEC PANEL
- Current Dir:
/
/
var
/
www
/
reader
/
API
/
vendor
/
zircote
/
swagger-php
/
tests
/
Analysers
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
08/07/2024 04:34:33 AM
rwxr-xr-x
📄
AttributeAnnotationFactoryTest.php
1.06 KB
08/07/2024 04:34:31 AM
rw-r--r--
📄
ComposerAutoloaderScannerTest.php
1 KB
08/07/2024 04:34:31 AM
rw-r--r--
📄
DocBlockParserTest.php
1.66 KB
08/07/2024 04:34:31 AM
rw-r--r--
📄
ReflectionAnalyserTest.php
7.25 KB
08/07/2024 04:34:31 AM
rw-r--r--
📄
TokenAnalyserTest.php
14.24 KB
08/07/2024 04:34:31 AM
rw-r--r--
📄
TokenScannerTest.php
14.19 KB
08/07/2024 04:34:31 AM
rw-r--r--
Editing: DocBlockParserTest.php
Close
<?php declare(strict_types=1); /** * @license Apache 2.0 */ namespace OpenApi\Tests\Analysers; use Doctrine\Common\Annotations\AnnotationRegistry; use OpenApi\Tests\OpenApiTestCase; class DocBlockParserTest extends OpenApiTestCase { public const SWG_ALIAS = ['swg' => 'OpenApi\Annotations']; public function testParseContents(): void { $annotations = $this->annotationsFromDocBlockParser('@OA\Parameter(description="This is my parameter")', self::SWG_ALIAS); $this->assertIsArray($annotations); $parameter = $annotations[0]; $this->assertInstanceOf('OpenApi\Annotations\Parameter', $parameter); $this->assertSame('This is my parameter', $parameter->description); } public function testDeprecatedAnnotationWarning(): void { /* @phpstan-ignore-next-line */ if (!class_exists(AnnotationRegistry::class, true) || !method_exists(AnnotationRegistry::class, 'registerLoader')) { $this->markTestSkipped('Not supported in doctrine/annotations v2'); } $this->assertOpenApiLogEntryContains('The annotation @SWG\Definition() is deprecated.'); $this->annotationsFromDocBlockParser('@SWG\Definition()', self::SWG_ALIAS); } public function testExtraAliases(): void { $extraAliases = [ 'contact' => 'OpenApi\Annotations\Contact', // use OpenApi\Annotations\Contact; 'ctest' => 'OpenApi\Tests\ConstantsTest', // use OpenApi\Tests\ConstantsTest as CTest; ]; $annotations = $this->annotationsFromDocBlockParser('@Contact(url=CTest::URL)', $extraAliases); $this->assertSame('http://example.com', $annotations[0]->url); } }