[DoctrineBundle] Fix bug in Auto Proxy Generation introduced with config merge refactoring
This commit is contained in:
parent
69fb235160
commit
2bc6197859
4
src/Symfony/Bundle/DoctrineBundle/DependencyInjection/DoctrineExtension.php
Normal file → Executable file
4
src/Symfony/Bundle/DoctrineBundle/DependencyInjection/DoctrineExtension.php
Normal file → Executable file
@ -281,10 +281,10 @@ class DoctrineExtension extends AbstractDoctrineExtension
|
||||
$mergedConfig['default_connection'] = $config['default_connection'];
|
||||
}
|
||||
if (isset($config['auto_generate_proxy_classes'])) {
|
||||
$mergedConfig['auto_generate_proxy_classes'] = $config['auto_generate_proxy_classes'];
|
||||
$defaultManagerOptions['auto_generate_proxy_classes'] = $config['auto_generate_proxy_classes'];
|
||||
}
|
||||
if (isset($config['auto-generate-proxy-classes'])) {
|
||||
$mergedConfig['auto_generate_proxy_classes'] = $config['auto-generate-proxy-classes'];
|
||||
$defaultManagerOptions['auto_generate_proxy_classes'] = $config['auto-generate-proxy-classes'];
|
||||
}
|
||||
}
|
||||
$defaultManagerOptions['connection'] = $mergedConfig['default_connection'];
|
||||
|
10
src/Symfony/Bundle/DoctrineBundle/Tests/DependencyInjection/AbstractDoctrineExtensionTest.php
Normal file → Executable file
10
src/Symfony/Bundle/DoctrineBundle/Tests/DependencyInjection/AbstractDoctrineExtensionTest.php
Normal file → Executable file
@ -424,18 +424,18 @@ abstract class AbstractDoctrineExtensionTest extends TestCase
|
||||
));
|
||||
}
|
||||
|
||||
public function testMultipleOrmLoadCalls()
|
||||
public function testOrmMergeConfigs()
|
||||
{
|
||||
$container = $this->getContainer(array('XmlBundle', 'AnnotationsBundle'));
|
||||
$loader = new DoctrineExtension();
|
||||
|
||||
$loader->dbalLoad(array(array()), $container);
|
||||
$loader->ormLoad(array(array(
|
||||
'auto_generate_proxy_dir' => true,
|
||||
'auto_generate_proxy_classes' => true,
|
||||
'mappings' => array('AnnotationsBundle' => array())
|
||||
),
|
||||
array(
|
||||
'auto_generate_proxy_dir' => false,
|
||||
'auto_generate_proxy_classes' => false,
|
||||
'mappings' => array('XmlBundle' => array())
|
||||
)), $container);
|
||||
|
||||
@ -450,7 +450,7 @@ abstract class AbstractDoctrineExtensionTest extends TestCase
|
||||
));
|
||||
|
||||
$configDef = $container->getDefinition('doctrine.orm.default_configuration');
|
||||
$this->assertDICDefinitionMethodCallOnce($configDef, 'setAutoGenerateProxyClasses', array(false));
|
||||
$this->assertDICDefinitionMethodCallOnce($configDef, 'setAutoGenerateProxyClasses', array( false ));
|
||||
}
|
||||
|
||||
public function testEntityManagerMetadataCacheDriverConfiguration()
|
||||
@ -513,7 +513,7 @@ abstract class AbstractDoctrineExtensionTest extends TestCase
|
||||
$this->assertEquals('%doctrine.orm.cache.apc_class%', $cacheDefinition->getClass());
|
||||
|
||||
$configDefinition = $container->getDefinition('doctrine.orm.default_configuration');
|
||||
$this->assertDICDefinitionMethodCallOnce($configDefinition, 'setAutoGenerateProxyClasses', array(false));
|
||||
$this->assertDICDefinitionMethodCallOnce($configDefinition, 'setAutoGenerateProxyClasses', array(true));
|
||||
}
|
||||
|
||||
public function testSingleEntityManagerMultipleMappingBundleDefinitions()
|
||||
|
Reference in New Issue
Block a user