Beispiel #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());
 }
Beispiel #2
0
 /**
  * Gets the fully qualified class name for the class,
  * property or method on which the doc comment is located.
  *
  * @return string A fully qualified class name.
  */
 public function getClassContext()
 {
     return parent::getDeclaringClass()->getName();
 }
Beispiel #3
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));
 }