<?phpnamespaceDoctrine\Tests\Common\Annotations;
useDoctrine\Common\Annotations\SimpleAnnotationReader;
class SimpleAnnotationReaderTestextends AbstractReaderTest {
/**
* Contrary to the behavior of the default annotation reader, we do just ignore
* these in the simple annotation reader (so, no expected exception here).
*/
public functiontestImportDetectsNotImportedAnnotation() {
parent::testImportDetectsNotImportedAnnotation();
}
/**
* Contrary to the behavior of the default annotation reader, we do just ignore
* these in the simple annotation reader (so, no expected exception here).
*/
public functiontestImportDetectsNonExistentAnnotation() {
parent::testImportDetectsNonExistentAnnotation();
}
/**
* Contrary to the behavior of the default annotation reader, we do just ignore
* these in the simple annotation reader (so, no expected exception here).
*/
public functiontestClassWithInvalidAnnotationTargetAtClassDocBlock() {
parent::testClassWithInvalidAnnotationTargetAtClassDocBlock();
}
/**
* Contrary to the behavior of the default annotation reader, we do just ignore
* these in the simple annotation reader (so, no expected exception here).
*/
public functiontestClassWithInvalidAnnotationTargetAtPropertyDocBlock() {
parent::testClassWithInvalidAnnotationTargetAtPropertyDocBlock();
}
/**
* Contrary to the behavior of the default annotation reader, we do just ignore
* these in the simple annotation reader (so, no expected exception here).
*/
public functiontestClassWithInvalidNestedAnnotationTargetAtPropertyDocBlock() {
parent::testClassWithInvalidNestedAnnotationTargetAtPropertyDocBlock();
}
/**
* Contrary to the behavior of the default annotation reader, we do just ignore
* these in the simple annotation reader (so, no expected exception here).
*/
public functiontestClassWithInvalidAnnotationTargetAtMethodDocBlock() {
parent::testClassWithInvalidAnnotationTargetAtMethodDocBlock();
}
/**
* @expectedException Doctrine\Common\Annotations\AnnotationException
*/
public functiontestInvalidAnnotationUsageButIgnoredClass() {
parent::testInvalidAnnotationUsageButIgnoredClass();
}
/**
* @group DDC-1660
* @group regression
*
* Contrary to the behavior of the default annotation reader, @version is not ignored
*/
public functiontestInvalidAnnotationButIgnored() {
$reader = $this
->getReader();
$class = new\ReflectionClass('Doctrine\\Tests\\Common\\Annotations\\Fixtures\\ClassDDC1660');
$this
->assertTrue(class_exists('Doctrine\\Tests\\Common\\Annotations\\Fixtures\\Annotation\\Version'));
$this
->assertCount(1, $reader
->getClassAnnotations($class));
$this
->assertCount(1, $reader
->getMethodAnnotations($class
->getMethod('bar')));
$this
->assertCount(1, $reader
->getPropertyAnnotations($class
->getProperty('foo')));
}
protected functiongetReader() {
$reader = newSimpleAnnotationReader();
$reader
->addNamespace(__NAMESPACE__);
$reader
->addNamespace(__NAMESPACE__ . '\\Fixtures');
$reader
->addNamespace(__NAMESPACE__ . '\\Fixtures\\Annotation');
return$reader;
}
}