From 0d683c1897681763ddd312e9625ac16f412f67d9 Mon Sep 17 00:00:00 2001 From: Marco Pivetta Date: Mon, 6 Oct 2014 14:22:06 +0200 Subject: [PATCH] DDC-3120 - metadata should be initialized before attempting new instance creation --- tests/Doctrine/Tests/ORM/Mapping/ClassMetadataTest.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/Doctrine/Tests/ORM/Mapping/ClassMetadataTest.php b/tests/Doctrine/Tests/ORM/Mapping/ClassMetadataTest.php index f97eb29e8..429cf0dc6 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/ClassMetadataTest.php +++ b/tests/Doctrine/Tests/ORM/Mapping/ClassMetadataTest.php @@ -1109,6 +1109,8 @@ class ClassMetadataTest extends \Doctrine\Tests\OrmTestCase { $classMetadata = new ClassMetadata(__NAMESPACE__ . '\\MyArrayObjectEntity'); + $classMetadata->initializeReflection(new \Doctrine\Common\Persistence\Mapping\RuntimeReflectionService); + $this->assertInstanceOf(__NAMESPACE__ . '\\MyArrayObjectEntity', $classMetadata->newInstance()); } @@ -1120,6 +1122,8 @@ class ClassMetadataTest extends \Doctrine\Tests\OrmTestCase /* @var $classMetadata ClassMetadata */ $classMetadata = unserialize(serialize(new ClassMetadata(__NAMESPACE__ . '\\MyArrayObjectEntity'))); + $classMetadata->initializeReflection(new \Doctrine\Common\Persistence\Mapping\RuntimeReflectionService); + $this->assertInstanceOf(__NAMESPACE__ . '\\MyArrayObjectEntity', $classMetadata->newInstance()); } }