public function testParseAnnotationDocblocks() { $class = new \ReflectionClass(__NAMESPACE__ . '\\DCOM55Annotation'); $reader = new \Doctrine\Common\Annotations\AnnotationReader(); $annots = $reader->getClassAnnotations($class); $this->assertEquals(0, count($annots)); }
public function testIssue() { $reader = new \Doctrine\Common\Annotations\AnnotationReader(); $result = $reader->getClassAnnotations(new \ReflectionClass(__NAMESPACE__ . "\\MappedClass")); foreach ($result as $annot) { $classAnnotations[get_class($annot)] = $annot; } $this->assertTrue(!isset($classAnnotations['']), 'Class "xxx" is not a valid entity or mapped super class.'); }
/** * @expectedException \Exception * @expectedExceptionMessage Class "xxx" is not a valid entity or mapped super class. */ public function testIssue() { $reader = new \Doctrine\Common\Annotations\AnnotationReader(); $result = $reader->getClassAnnotations(new \ReflectionClass(__NAMESPACE__ . "\\MappedClass")); foreach ($result as $annot) { $classAnnotations[get_class($annot)] = $annot; } // Evaluate Entity annotation if (!isset($classAnnotations['Doctrine\\Tests\\Common\\Annotations\\Ticket\\Doctrine\\ORM\\Mapping\\Entity'])) { throw new \Exception('Class "xxx" is not a valid entity or mapped super class.'); } }