/** * 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()); }
/** * 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(); }
/** * 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)); }