Example #1
0
 /**
  * Test if the `getAnnotationList` method return a list of all annotations in a doc comment.
  */
 public function testGetAnnotationList()
 {
     $method = new ReflectionMethod('\\com\\mohiva\\test\\resources\\common\\lang\\AnnotationTest', 'value');
     $this->assertInstanceOf('com\\mohiva\\common\\lang\\AnnotationList', $method->getAnnotationList());
 }
Example #2
0
 /**
  * Test if an annotation with a fully qualified name can be loaded.
  */
 public function testFullyQualifiedName()
 {
     $class = 'com\\mohiva\\test\\resources\\common\\lang\\annotations\\FuncGetArgs';
     $reflection = new ReflectionMethod(self::TEST_CLASS, 'fullyQualifiedName');
     $annotation = $reflection->getAnnotationList()->getAnnotations(FuncGetArgs::NAME)->getIterator()->current();
     /* @var \com\mohiva\test\resources\common\lang\annotations\FuncGetArgs $annotation */
     $this->assertInstanceOf($class, $annotation);
     $this->assertInternalType(PHPUnitType::TYPE_ARRAY, $annotation->getValues());
     $this->assertSame($annotation->getValues(), range(1, 10));
 }