Permalink
Browse files

Fix DDC-1660

  • Loading branch information...
1 parent fc26d10 commit 842bf5883c405e89d211e5ccfff1d8d64e05a486 @FabioBatSilva committed Feb 20, 2012
@@ -555,7 +555,7 @@ private function Annotation()
// only process names which are not fully qualified, yet
// fully qualified names must start with a \
$originalName = $name;
- if ('\\' !== $name[0]) {
+ if ('\\' !== $name[0] && $name[0] === strtoupper($name[0])) {
$alias = (false === $pos = strpos($name, '\\'))? $name : substr($name, 0, $pos);
$found = false;
@@ -591,6 +591,9 @@ private function Annotation()
}
if (!$this->classExists($name)) {
+ if ($this->ignoreNotImportedAnnotations || isset($this->ignoredAnnotationNames[$name])) {
+ return false;
+ }
throw AnnotationException::semanticalError(sprintf('The annotation "@%s" in %s does not exist, or could not be auto-loaded.', $name, $this->context));
}
@@ -311,6 +311,17 @@ public function testInvalidAnnotationUsageButIgnoredClass()
$this->assertEquals(2, count($annots));
}
+ /**
+ * @group DDC-1660
+ */
+ public function testInvalidLowerAnnotationButIgnored()
+ {
+ $reader = $this->getReader();
+ $class = new \ReflectionClass('Doctrine\Tests\Common\Annotations\Fixtures\ClassDDC1660');
+ $annots = $reader->getClassAnnotations($class);
+ $this->assertEquals(0, count($annots));
+ }
+
abstract protected function getReader();
}
@@ -0,0 +1,11 @@
+<?php
+
+namespace Doctrine\Tests\Common\Annotations\Fixtures\Annotation;
+
+/**
+ * @Annotation
+ * @Target("PROPERTY")
+ */
+final class Version
+{
+}
@@ -0,0 +1,13 @@
+<?php
+
+namespace Doctrine\Tests\Common\Annotations\Fixtures;
+
+
+/**
+ * @since 2.0
+ * @version $Id: SomeEntityClass.php 509 2012-02-03 09:38:48Z mf $
+ */
+class ClassDDC1660
+{
+
+}

0 comments on commit 842bf58

Please sign in to comment.