diff --git a/tests/Doctrine/Tests/ORM/Mapping/ClassMetadataTest.php b/tests/Doctrine/Tests/ORM/Mapping/ClassMetadataTest.php index 5de685733..36b92f81d 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/ClassMetadataTest.php +++ b/tests/Doctrine/Tests/ORM/Mapping/ClassMetadataTest.php @@ -3,6 +3,7 @@ namespace Doctrine\Tests\ORM\Mapping; use Doctrine\Common\Persistence\Mapping\RuntimeReflectionService; +use Doctrine\Common\Persistence\Mapping\StaticReflectionService; use Doctrine\ORM\Mapping\ClassMetadata; use Doctrine\ORM\Events; use Doctrine\ORM\Mapping\DefaultNamingStrategy; @@ -1137,6 +1138,20 @@ class ClassMetadataTest extends \Doctrine\Tests\OrmTestCase $classMetadata->getAllReflectionProperties(); } + + /** + * @group DDC-2704 + */ + public function testGetAllReflectionPropertiesFailsOnPartiallyInitializedMetadata() + { + $classMetadata = new ClassMetadata(__NAMESPACE__ . '\\MyArrayObjectEntity'); + + $classMetadata->initializeReflection(new StaticReflectionService()); + + $this->setExpectedException('RuntimeException'); + + $classMetadata->getAllReflectionProperties(); + } } /**