From c2993bcdeb2873d876e2e70a88078d08babef7f4 Mon Sep 17 00:00:00 2001 From: Marco Pivetta Date: Thu, 14 Aug 2014 15:39:58 +0200 Subject: [PATCH] DDC-3120 - add failing test for un-serialization of an internal PHP class from cached metadata instance --- .../Doctrine/Tests/ORM/Mapping/ClassMetadataTest.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/Doctrine/Tests/ORM/Mapping/ClassMetadataTest.php b/tests/Doctrine/Tests/ORM/Mapping/ClassMetadataTest.php index 456e9d2ac..21ca6b835 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/ClassMetadataTest.php +++ b/tests/Doctrine/Tests/ORM/Mapping/ClassMetadataTest.php @@ -1110,6 +1110,17 @@ class ClassMetadataTest extends \Doctrine\Tests\OrmTestCase $this->assertInstanceOf(__NAMESPACE__ . '\\MyArrayObjectEntity', $classMetadata->newInstance()); } + + /** + * @group DDC-3120 + */ + public function testCanInstantiateInternalPhpClassSubclassFromUnserializedMetadata() + { + /* @var $classMetadata ClassMetadata */ + $classMetadata = unserialize(serialize(new ClassMetadata(__NAMESPACE__ . '\\MyArrayObjectEntity'))); + + $this->assertInstanceOf(__NAMESPACE__ . '\\MyArrayObjectEntity', $classMetadata->newInstance()); + } } /**