diff --git a/lib/Doctrine/ORM/Proxy/ProxyFactory.php b/lib/Doctrine/ORM/Proxy/ProxyFactory.php index 7a1a2c671..fd2178da7 100644 --- a/lib/Doctrine/ORM/Proxy/ProxyFactory.php +++ b/lib/Doctrine/ORM/Proxy/ProxyFactory.php @@ -91,7 +91,7 @@ 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(); } /** diff --git a/tests/Doctrine/Tests/ORM/Proxy/ProxyFactoryTest.php b/tests/Doctrine/Tests/ORM/Proxy/ProxyFactoryTest.php index fd4fa6648..0207f72c2 100644 --- a/tests/Doctrine/Tests/ORM/Proxy/ProxyFactoryTest.php +++ b/tests/Doctrine/Tests/ORM/Proxy/ProxyFactoryTest.php @@ -71,6 +71,26 @@ class ProxyFactoryTest extends \Doctrine\Tests\OrmTestCase $proxy->getDescription(); } + public function testSkipMappedSuperClassesOnGeneration() + { + $cm = new ClassMetadata(\stdClass::class); + $cm->isMappedSuperclass = true; + + $num = $this->proxyFactory->generateProxyClasses([$cm]); + + $this->assertEquals(0, $num, "No proxies generated."); + } + + public function testSkipEmbeddableClassesOnGeneration() + { + $cm = new ClassMetadata(\stdClass::class); + $cm->isEmbeddedClass = true; + + $num = $this->proxyFactory->generateProxyClasses([$cm]); + + $this->assertEquals(0, $num, "No proxies generated."); + } + /** * @group DDC-1771 */