AnalyserTest.php 773 B

1234567891011121314151617181920212223242526
  1. <?php declare(strict_types=1);
  2. /**
  3. * @license Apache 2.0
  4. */
  5. namespace OpenApiTests;
  6. class AnalyserTest extends OpenApiTestCase
  7. {
  8. public function testParseContents()
  9. {
  10. $annotations = $this->parseComment('@OA\Parameter(description="This is my parameter")');
  11. $this->assertIsArray($annotations);
  12. $parameter = $annotations[0];
  13. $this->assertInstanceOf('OpenApi\Annotations\Parameter', $parameter);
  14. $this->assertSame('This is my parameter', $parameter->description);
  15. }
  16. public function testDeprecatedAnnotationWarning()
  17. {
  18. $this->countExceptions = 1;
  19. $this->assertOpenApiLogEntryStartsWith('The annotation @SWG\Definition() is deprecated.');
  20. $this->parseComment('@SWG\Definition()');
  21. }
  22. }