[DoctrineBundle] removed the possibility to define an empty configuration for the DBAL (which does not make sense in real-life)
This commit is contained in:
parent
55f9e6fb99
commit
03511dea5c
@ -58,11 +58,6 @@ class Configuration implements ConfigurationInterface
|
|||||||
$node
|
$node
|
||||||
->children()
|
->children()
|
||||||
->arrayNode('dbal')
|
->arrayNode('dbal')
|
||||||
->beforeNormalization()
|
|
||||||
->ifNull()
|
|
||||||
// Define a default connection using the default values
|
|
||||||
->then(function($v) { return array ('connections' => array('default' => array())); })
|
|
||||||
->end()
|
|
||||||
->children()
|
->children()
|
||||||
->scalarNode('default_connection')->end()
|
->scalarNode('default_connection')->end()
|
||||||
->end()
|
->end()
|
||||||
|
@ -41,7 +41,7 @@ abstract class AbstractDoctrineExtensionTest extends TestCase
|
|||||||
$container = $this->getContainer();
|
$container = $this->getContainer();
|
||||||
$loader = new DoctrineExtension();
|
$loader = new DoctrineExtension();
|
||||||
|
|
||||||
$loader->load(array(array('dbal' => array('connections' => array('default'=> array('password' => 'foo')))), array(), array('dbal' => array('default_connection' => 'foo')), array()), $container);
|
$loader->load(array(array('dbal' => array('connections' => array('default' => array('password' => 'foo')))), array(), array('dbal' => array('default_connection' => 'foo')), array()), $container);
|
||||||
|
|
||||||
$arguments = $container->getDefinition('doctrine.dbal.default_connection')->getArguments();
|
$arguments = $container->getDefinition('doctrine.dbal.default_connection')->getArguments();
|
||||||
$config = $arguments[0];
|
$config = $arguments[0];
|
||||||
@ -109,7 +109,7 @@ abstract class AbstractDoctrineExtensionTest extends TestCase
|
|||||||
$container = $this->getContainer();
|
$container = $this->getContainer();
|
||||||
$loader = new DoctrineExtension();
|
$loader = new DoctrineExtension();
|
||||||
|
|
||||||
$loader->load(array(array('dbal' => null, 'orm' => array('default_entity_manager' => 'default', 'entity_managers' => array('default' => array('mappings' => array('YamlBundle' => array())))))), $container);
|
$loader->load(array(array('dbal' => array('connections' => array('default' => array('password' => 'foo'))), 'orm' => array('default_entity_manager' => 'default', 'entity_managers' => array('default' => array('mappings' => array('YamlBundle' => array())))))), $container);
|
||||||
|
|
||||||
$this->assertFalse($container->getParameter('doctrine.orm.auto_generate_proxy_classes'));
|
$this->assertFalse($container->getParameter('doctrine.orm.auto_generate_proxy_classes'));
|
||||||
$this->assertEquals('Doctrine\ORM\Configuration', $container->getParameter('doctrine.orm.configuration.class'));
|
$this->assertEquals('Doctrine\ORM\Configuration', $container->getParameter('doctrine.orm.configuration.class'));
|
||||||
@ -140,7 +140,7 @@ abstract class AbstractDoctrineExtensionTest extends TestCase
|
|||||||
);
|
);
|
||||||
|
|
||||||
$container = $this->getContainer();
|
$container = $this->getContainer();
|
||||||
$loader->load(array(array('dbal' => null, 'orm' => $config)), $container);
|
$loader->load(array(array('dbal' => array('connections' => array('default' => array('password' => 'foo'))), 'orm' => $config)), $container);
|
||||||
$this->compileContainer($container);
|
$this->compileContainer($container);
|
||||||
|
|
||||||
$definition = $container->getDefinition('doctrine.dbal.default_connection');
|
$definition = $container->getDefinition('doctrine.dbal.default_connection');
|
||||||
@ -189,7 +189,7 @@ abstract class AbstractDoctrineExtensionTest extends TestCase
|
|||||||
$container = $this->getContainer();
|
$container = $this->getContainer();
|
||||||
$loader = new DoctrineExtension();
|
$loader = new DoctrineExtension();
|
||||||
|
|
||||||
$loader->load(array(array('dbal' => null, 'orm' => array('default_entity_manager' => 'default', 'entity_managers' => array('default' => array('mappings' => array('YamlBundle' => array())))))), $container);
|
$loader->load(array(array('dbal' => array('connections' => array('default' => array('password' => 'foo'))), 'orm' => array('default_entity_manager' => 'default', 'entity_managers' => array('default' => array('mappings' => array('YamlBundle' => array())))))), $container);
|
||||||
$this->compileContainer($container);
|
$this->compileContainer($container);
|
||||||
|
|
||||||
$definition = $container->getDefinition('doctrine.dbal.default_connection');
|
$definition = $container->getDefinition('doctrine.dbal.default_connection');
|
||||||
@ -221,13 +221,14 @@ abstract class AbstractDoctrineExtensionTest extends TestCase
|
|||||||
|
|
||||||
$this->assertDICConstructorArguments($definition, array(
|
$this->assertDICConstructorArguments($definition, array(
|
||||||
array(
|
array(
|
||||||
|
'dbname' => 'db',
|
||||||
'host' => 'localhost',
|
'host' => 'localhost',
|
||||||
'driver' => 'pdo_mysql',
|
'port' => null,
|
||||||
'driverOptions' => array(),
|
|
||||||
'user' => 'root',
|
'user' => 'root',
|
||||||
'password' => null,
|
'password' => null,
|
||||||
'port' => null,
|
'driver' => 'pdo_mysql',
|
||||||
'logging' => false,
|
'logging' => false,
|
||||||
|
'driverOptions' => array(),
|
||||||
),
|
),
|
||||||
new Reference('doctrine.dbal.default_connection.configuration'),
|
new Reference('doctrine.dbal.default_connection.configuration'),
|
||||||
new Reference('doctrine.dbal.default_connection.event_manager')
|
new Reference('doctrine.dbal.default_connection.event_manager')
|
||||||
|
@ -7,7 +7,10 @@
|
|||||||
http://symfony.com/schema/dic/doctrine http://symfony.com/schema/dic/doctrine/doctrine-1.0.xsd">
|
http://symfony.com/schema/dic/doctrine http://symfony.com/schema/dic/doctrine/doctrine-1.0.xsd">
|
||||||
|
|
||||||
<config>
|
<config>
|
||||||
<dbal />
|
<dbal default-connection="default">
|
||||||
|
<connection name="default" dbname="db" />
|
||||||
|
</dbal>
|
||||||
|
|
||||||
<orm default-entity-manager="default">
|
<orm default-entity-manager="default">
|
||||||
<entity-manager name="default">
|
<entity-manager name="default">
|
||||||
<metadata-cache-driver type="memcache">
|
<metadata-cache-driver type="memcache">
|
||||||
|
@ -7,6 +7,10 @@
|
|||||||
http://symfony.com/schema/dic/doctrine http://symfony.com/schema/dic/doctrine/doctrine-1.0.xsd">
|
http://symfony.com/schema/dic/doctrine http://symfony.com/schema/dic/doctrine/doctrine-1.0.xsd">
|
||||||
|
|
||||||
<config>
|
<config>
|
||||||
|
<dbal default-connection="default">
|
||||||
|
<connection name="default" dbname="db" />
|
||||||
|
</dbal>
|
||||||
|
|
||||||
<orm default-entity-manager="default">
|
<orm default-entity-manager="default">
|
||||||
<entity-manager name="default">
|
<entity-manager name="default">
|
||||||
<mapping name="AnnotationsBundle" />
|
<mapping name="AnnotationsBundle" />
|
||||||
|
@ -1,5 +1,10 @@
|
|||||||
doctrine:
|
doctrine:
|
||||||
dbal: ~
|
dbal:
|
||||||
|
default_connection: default
|
||||||
|
connections:
|
||||||
|
default:
|
||||||
|
dbname: db
|
||||||
|
|
||||||
orm:
|
orm:
|
||||||
default_entity_manager: default
|
default_entity_manager: default
|
||||||
entity_managers:
|
entity_managers:
|
||||||
|
@ -1,4 +1,10 @@
|
|||||||
doctrine:
|
doctrine:
|
||||||
|
dbal:
|
||||||
|
default_connection: default
|
||||||
|
connections:
|
||||||
|
default:
|
||||||
|
dbname: db
|
||||||
|
|
||||||
orm:
|
orm:
|
||||||
default_entity_manager: default
|
default_entity_manager: default
|
||||||
entity_managers:
|
entity_managers:
|
||||||
|
Reference in New Issue
Block a user