Example #1
0
 /**
  * Test if the `SingleParameterAnnotation` class has correct values.
  */
 public function testSingleParameterAnnotation()
 {
     $class = 'com\\mohiva\\test\\resources\\common\\lang\\annotations\\SingleParameter';
     $reflection = new ReflectionProperty(self::TEST_CLASS, 'singleParameter');
     $iterator = $reflection->getAnnotationList()->getAnnotations(SingleParameter::NAME)->getIterator();
     /* @var \com\mohiva\test\resources\common\lang\annotations\SingleParameter $annotation */
     $annotation = $iterator->current();
     $this->assertInstanceOf($class, $annotation);
     $this->assertSame($annotation->getParam1(), 'param1');
     $iterator->next();
     $annotation = $iterator->current();
     $this->assertInstanceOf($class, $annotation);
     $this->assertSame($annotation->getParam1(), 'param1');
 }
Example #2
0
 /**
  * Test if the `getAnnotationList` method return a list of all annotations in a doc comment.
  */
 public function testGetAnnotationList()
 {
     $property = new ReflectionProperty('\\com\\mohiva\\test\\resources\\common\\lang\\AnnotationTest', 'nested');
     $this->assertInstanceOf('com\\mohiva\\common\\lang\\AnnotationList', $property->getAnnotationList());
 }