From d52dd3959213a553b67bd7cdba259f3e38af88e1 Mon Sep 17 00:00:00 2001 From: Marco Pivetta Date: Thu, 14 Aug 2014 15:38:55 +0200 Subject: [PATCH] DDC-3120 - add failing test for un-serialization of an internal PHP class --- .../Tests/ORM/Mapping/ClassMetadataTest.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/Doctrine/Tests/ORM/Mapping/ClassMetadataTest.php b/tests/Doctrine/Tests/ORM/Mapping/ClassMetadataTest.php index 2c35dc192..456e9d2ac 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/ClassMetadataTest.php +++ b/tests/Doctrine/Tests/ORM/Mapping/ClassMetadataTest.php @@ -1100,6 +1100,16 @@ class ClassMetadataTest extends \Doctrine\Tests\OrmTestCase $this->assertFalse($class->isIdentifier('foo')); } + + /** + * @group DDC-3120 + */ + public function testCanInstantiateInternalPhpClassSubclass() + { + $classMetadata = new ClassMetadata(__NAMESPACE__ . '\\MyArrayObjectEntity'); + + $this->assertInstanceOf(__NAMESPACE__ . '\\MyArrayObjectEntity', $classMetadata->newInstance()); + } } /** @@ -1136,3 +1146,7 @@ class MyPrefixNamingStrategy extends \Doctrine\ORM\Mapping\DefaultNamingStrategy return strtolower($this->classToTableName($className)) . '_' . $propertyName; } } + +class MyArrayObjectEntity extends \ArrayObject +{ +}