AnalyserTest.php 783 B

12345678910111213141516171819202122232425262728
  1. <?php
  2. /**
  3. * @license Apache 2.0
  4. */
  5. namespace SwaggerTests;
  6. use Swagger\Context;
  7. use Swagger\Analyser;
  8. class AnalyserTest extends SwaggerTestCase
  9. {
  10. public function testParseContents()
  11. {
  12. $annotations = $this->parseComment('@SWG\Parameter(description="This is my parameter")');
  13. $this->assertInternalType('array', $annotations);
  14. $parameter = $annotations[0];
  15. $this->assertInstanceOf('Swagger\Annotations\Parameter', $parameter);
  16. $this->assertSame('This is my parameter', $parameter->description);
  17. }
  18. public function testDeprecatedAnnotationWarning()
  19. {
  20. $this->assertSwaggerLogEntryStartsWith('The annotation @SWG\\Resource() is deprecated.');
  21. $annotations = $this->parseComment('@SWG\Resource()');
  22. }
  23. }