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 +{ +}