Example #1
0
 public function testGetAllClassAnnotations()
 {
     $annotations = $this->extractor->getAllClassAnnotations('Zckrs\\GenDocApi\\Test\\Client');
     $this->assertCount(1, $annotations, 'Number of Client methods');
     $this->assertArrayHasKey('Zckrs\\GenDocApi\\Test\\Client', $annotations);
     $this->assertArrayHasKey('get', $annotations['Zckrs\\GenDocApi\\Test\\Client']);
     $this->assertCount(5, $annotations['Zckrs\\GenDocApi\\Test\\Client']['get'], 'Number of annotation for the get method');
     $this->assertCount(1, $annotations['Zckrs\\GenDocApi\\Test\\Client']['get']['ApiDescription'], 'Number of ApiDescription annotations for the get method');
     $this->assertCount(1, $annotations['Zckrs\\GenDocApi\\Test\\Client']['get']['ApiDescription'], 'Number of ApiDescription annotations for the get method');
     $this->assertArrayHasKey('section', $annotations['Zckrs\\GenDocApi\\Test\\Client']['get']['ApiDescription'][0], 'The "section" attribute for get/ApiDescription annotation exists');
     $this->assertArrayHasKey('description', $annotations['Zckrs\\GenDocApi\\Test\\Client']['get']['ApiDescription'][0], 'The "description" attribute for get/ApiDescription annotation exists');
 }
Example #2
0
 /**
  * Extract annotations
  *
  * @return array
  */
 private function extractAnnotations()
 {
     foreach ($this->classes as $class) {
         $st_output[] = Extractor::getAllClassAnnotations($class);
     }
     return end($st_output);
 }