3 namespace Doctrine\Tests\Common\Annotations;
5 use Doctrine\Common\Annotations\SimpleAnnotationReader;
7 class SimpleAnnotationReaderTest extends AbstractReaderTest
10 * Contrary to the behavior of the default annotation reader, we do just ignore
11 * these in the simple annotation reader (so, no expected exception here).
13 public function testImportDetectsNotImportedAnnotation()
15 parent::testImportDetectsNotImportedAnnotation();
19 * Contrary to the behavior of the default annotation reader, we do just ignore
20 * these in the simple annotation reader (so, no expected exception here).
22 public function testImportDetectsNonExistentAnnotation()
24 parent::testImportDetectsNonExistentAnnotation();
28 * Contrary to the behavior of the default annotation reader, we do just ignore
29 * these in the simple annotation reader (so, no expected exception here).
31 public function testClassWithInvalidAnnotationTargetAtClassDocBlock()
33 parent::testClassWithInvalidAnnotationTargetAtClassDocBlock();
37 * Contrary to the behavior of the default annotation reader, we do just ignore
38 * these in the simple annotation reader (so, no expected exception here).
40 public function testClassWithInvalidAnnotationTargetAtPropertyDocBlock()
42 parent::testClassWithInvalidAnnotationTargetAtPropertyDocBlock();
46 * Contrary to the behavior of the default annotation reader, we do just ignore
47 * these in the simple annotation reader (so, no expected exception here).
49 public function testClassWithInvalidNestedAnnotationTargetAtPropertyDocBlock()
51 parent::testClassWithInvalidNestedAnnotationTargetAtPropertyDocBlock();
55 * Contrary to the behavior of the default annotation reader, we do just ignore
56 * these in the simple annotation reader (so, no expected exception here).
58 public function testClassWithInvalidAnnotationTargetAtMethodDocBlock()
60 parent::testClassWithInvalidAnnotationTargetAtMethodDocBlock();
64 * @expectedException Doctrine\Common\Annotations\AnnotationException
66 public function testInvalidAnnotationUsageButIgnoredClass()
68 parent::testInvalidAnnotationUsageButIgnoredClass();
75 * Contrary to the behavior of the default annotation reader, @version is not ignored
77 public function testInvalidAnnotationButIgnored()
79 $reader = $this->getReader();
80 $class = new \ReflectionClass('Doctrine\Tests\Common\Annotations\Fixtures\ClassDDC1660');
82 $this->assertTrue(class_exists('Doctrine\Tests\Common\Annotations\Fixtures\Annotation\Version'));
83 $this->assertCount(1, $reader->getClassAnnotations($class));
84 $this->assertCount(1, $reader->getMethodAnnotations($class->getMethod('bar')));
85 $this->assertCount(1, $reader->getPropertyAnnotations($class->getProperty('foo')));
88 protected function getReader()
90 $reader = new SimpleAnnotationReader();
91 $reader->addNamespace(__NAMESPACE__);
92 $reader->addNamespace(__NAMESPACE__ . '\Fixtures');
93 $reader->addNamespace(__NAMESPACE__ . '\Fixtures\Annotation');