1
0
mirror of synced 2025-03-10 14:56:11 +03:00

Merge branch 'fix/#6626-skip-proxy-generation-for-embeddable-classes-2.5' into 2.5

Backport 
Backport 
This commit is contained in:
Marco Pivetta 2017-08-16 15:21:29 +02:00
commit 6184343fd5
No known key found for this signature in database
GPG Key ID: 4167D3337FD9D629
2 changed files with 30 additions and 1 deletions
lib/Doctrine/ORM/Proxy
tests/Doctrine/Tests/ORM/Proxy

@ -91,7 +91,9 @@ class ProxyFactory extends AbstractProxyFactory
protected function skipClass(ClassMetadata $metadata)
{
/* @var $metadata \Doctrine\ORM\Mapping\ClassMetadataInfo */
return $metadata->isMappedSuperclass || $metadata->getReflectionClass()->isAbstract();
return $metadata->isMappedSuperclass
|| $metadata->isEmbeddedClass
|| $metadata->getReflectionClass()->isAbstract();
}
/**

@ -71,6 +71,33 @@ class ProxyFactoryTest extends \Doctrine\Tests\OrmTestCase
$proxy->getDescription();
}
public function testSkipMappedSuperClassesOnGeneration()
{
$cm = new ClassMetadata('stdClass');
$cm->isMappedSuperclass = true;
self::assertSame(
0,
$this->proxyFactory->generateProxyClasses([$cm]),
'No proxies generated.'
);
}
/**
* @group 6625
*/
public function testSkipEmbeddableClassesOnGeneration()
{
$cm = new ClassMetadata('stdClass');
$cm->isEmbeddedClass = true;
self::assertSame(
0,
$this->proxyFactory->generateProxyClasses([$cm]),
'No proxies generated.'
);
}
/**
* @group DDC-1771
*/