1
0
mirror of synced 2025-02-20 22:23:14 +03:00

DDC-3272 - failing test (to be run in insulation because of autoloading) that verifies that a wrong annotation is generated for @MappedSuperclass

This commit is contained in:
Marco Pivetta 2014-09-10 16:40:17 +02:00
parent e2fea427a4
commit b9090ef73e

View File

@ -284,6 +284,36 @@ class EntityGeneratorTest extends \Doctrine\Tests\OrmTestCase
$this->assertEquals($cm->customRepositoryClassName, $metadata->customRepositoryClassName);
}
/**
* @group DDC-3272
*/
public function testMappedSuperclassAnnotationGeneration()
{
$metadata = new ClassMetadataInfo($this->_namespace . '\EntityGeneratorBook');
$metadata->namespace = $this->_namespace;
$metadata->isMappedSuperclass = true;
$this->_generator->setAnnotationPrefix('ORM\\');
$this->_generator->writeEntityClass($metadata, $this->_tmpDir);
// force instantiation (causes autoloading to kick in)
$this->newInstance($metadata);
$driver = new \Doctrine\ORM\Mapping\Driver\AnnotationDriver(
new \Doctrine\Common\Annotations\AnnotationReader(),
array()
);
$cm = new \Doctrine\ORM\Mapping\ClassMetadata($metadata->name);
$cm->initializeReflection(new \Doctrine\Common\Persistence\Mapping\RuntimeReflectionService);
$driver->loadMetadataForClass($cm->name, $cm);
$this->assertTrue($cm->isMappedSuperclass);
}
/**
* @dataProvider getParseTokensInEntityFileData
*/