diff --git a/src/Symfony/Bundle/DoctrineMongoDBBundle/Tests/ContainerTest.php b/src/Symfony/Bundle/DoctrineMongoDBBundle/Tests/ContainerTest.php index 8c79cae1fbb8..701d7ba7dc7a 100644 --- a/src/Symfony/Bundle/DoctrineMongoDBBundle/Tests/ContainerTest.php +++ b/src/Symfony/Bundle/DoctrineMongoDBBundle/Tests/ContainerTest.php @@ -23,7 +23,7 @@ public function getContainer() require_once __DIR__.'/DependencyInjection/Fixtures/Bundles/YamlBundle/YamlBundle.php'; $container = new ContainerBuilder(new ParameterBag(array( - 'kernel.bundles' => array('YamlBundle' => 'DoctrineMongoDBBundle\Tests\DependencyInjection\Fixtures\Bundles\YamlBundle\YamlBundle'), + 'kernel.bundles' => array('Yaml' => 'DoctrineMongoDBBundle\Tests\DependencyInjection\Fixtures\Bundles\YamlBundle\YamlBundle'), 'kernel.cache_dir' => sys_get_temp_dir(), 'kernel.debug' => false, ))); @@ -31,7 +31,7 @@ public function getContainer() $container->registerExtension($loader); $configs = array(); - $configs[] = array('connections' => array('default' => array()), 'document_managers' => array('default' => array('mappings' => array('YamlBundle' => array())))); + $configs[] = array('connections' => array('default' => array()), 'document_managers' => array('default' => array('mappings' => array('Yaml' => array())))); $loader->load($configs, $container); return $container; diff --git a/src/Symfony/Bundle/DoctrineMongoDBBundle/Tests/DependencyInjection/AbstractMongoDBExtensionTest.php b/src/Symfony/Bundle/DoctrineMongoDBBundle/Tests/DependencyInjection/AbstractMongoDBExtensionTest.php index 2e9febf99b37..9c19eebebdc9 100644 --- a/src/Symfony/Bundle/DoctrineMongoDBBundle/Tests/DependencyInjection/AbstractMongoDBExtensionTest.php +++ b/src/Symfony/Bundle/DoctrineMongoDBBundle/Tests/DependencyInjection/AbstractMongoDBExtensionTest.php @@ -225,20 +225,20 @@ public function testBundleDocumentAliases() $container = $this->getContainer(); $loader = new DoctrineMongoDBExtension(); - $loader->load(array(array('document_managers' => array('default' => array('mappings' => array('YamlBundle' => array()))))), $container); + $loader->load(array(array('document_managers' => array('default' => array('mappings' => array('Yaml' => array()))))), $container); $definition = $container->getDefinition('doctrine.odm.mongodb.default_configuration'); $calls = $definition->getMethodCalls(); - $this->assertTrue(isset($calls[0][1][0]['YamlBundle'])); - $this->assertEquals('DoctrineMongoDBBundle\Tests\DependencyInjection\Fixtures\Bundles\YamlBundle\Document', $calls[0][1][0]['YamlBundle']); + $this->assertTrue(isset($calls[0][1][0]['Yaml'])); + $this->assertEquals('DoctrineMongoDBBundle\Tests\DependencyInjection\Fixtures\Bundles\YamlBundle\Document', $calls[0][1][0]['Yaml']); } public function testYamlBundleMappingDetection() { $container = $this->getContainer(); - $loader = new DoctrineMongoDBExtension('YamlBundle'); + $loader = new DoctrineMongoDBExtension(); - $loader->load(array(array('document_managers' => array('default' => array('mappings' => array('YamlBundle' => array()))))), $container); + $loader->load(array(array('document_managers' => array('default' => array('mappings' => array('Yaml' => array()))))), $container); $calls = $container->getDefinition('doctrine.odm.mongodb.default_metadata_driver')->getMethodCalls(); $this->assertEquals('doctrine.odm.mongodb.default_yml_metadata_driver', (string) $calls[0][1][0]); @@ -250,7 +250,7 @@ public function testXmlBundleMappingDetection() $container = $this->getContainer('XmlBundle'); $loader = new DoctrineMongoDBExtension(); - $loader->load(array(array('document_managers' => array('default' => array('mappings' => array('XmlBundle' => array()))))), $container); + $loader->load(array(array('document_managers' => array('default' => array('mappings' => array('Xml' => array()))))), $container); $calls = $container->getDefinition('doctrine.odm.mongodb.default_metadata_driver')->getMethodCalls(); $this->assertEquals('doctrine.odm.mongodb.default_xml_metadata_driver', (string) $calls[0][1][0]); @@ -262,7 +262,7 @@ public function testAnnotationsBundleMappingDetection() $container = $this->getContainer('AnnotationsBundle'); $loader = new DoctrineMongoDBExtension(); - $loader->load(array(array('document_managers' => array('default' => array('mappings' => array('AnnotationsBundle' => array()))))), $container); + $loader->load(array(array('document_managers' => array('default' => array('mappings' => array('Annotations' => array()))))), $container); $calls = $container->getDefinition('doctrine.odm.mongodb.default_metadata_driver')->getMethodCalls(); $this->assertEquals('doctrine.odm.mongodb.default_annotation_metadata_driver', (string) $calls[0][1][0]); @@ -352,9 +352,8 @@ protected function getContainer($bundle = 'YamlBundle') { require_once __DIR__.'/Fixtures/Bundles/'.$bundle.'/'.$bundle.'.php'; - return new ContainerBuilder(new ParameterBag(array( - 'kernel.bundles' => array($bundle => 'DoctrineMongoDBBundle\\Tests\\DependencyInjection\\Fixtures\\Bundles\\'.$bundle.'\\'.$bundle), + 'kernel.bundles' => array(substr($bundle, 0, -6) => 'DoctrineMongoDBBundle\\Tests\\DependencyInjection\\Fixtures\\Bundles\\'.$bundle.'\\'.$bundle), 'kernel.cache_dir' => sys_get_temp_dir(), 'kernel.debug' => false, ))); diff --git a/src/Symfony/Bundle/DoctrineMongoDBBundle/Tests/DependencyInjection/ConfigurationTest.php b/src/Symfony/Bundle/DoctrineMongoDBBundle/Tests/DependencyInjection/ConfigurationTest.php index a06a7a0957f8..21262c5e062b 100644 --- a/src/Symfony/Bundle/DoctrineMongoDBBundle/Tests/DependencyInjection/ConfigurationTest.php +++ b/src/Symfony/Bundle/DoctrineMongoDBBundle/Tests/DependencyInjection/ConfigurationTest.php @@ -86,7 +86,7 @@ public function testFullConfiguration($config) 'document_managers' => array( 'dm1' => array( 'mappings' => array( - 'FooBundle' => array( + 'Foo' => array( 'type' => 'annotations', ), ), @@ -103,7 +103,7 @@ public function testFullConfiguration($config) 'connection' => 'dm2_connection', 'database' => 'db1', 'mappings' => array( - 'BarBundle' => array( + 'Bar' => array( 'type' => 'yml', 'dir' => '%kernel.cache_dir%', 'prefix' => 'prefix_val', diff --git a/src/Symfony/Bundle/DoctrineMongoDBBundle/Tests/DependencyInjection/Fixtures/config/yml/full.yml b/src/Symfony/Bundle/DoctrineMongoDBBundle/Tests/DependencyInjection/Fixtures/config/yml/full.yml index 6ebed849a132..f6032bc3f2fd 100644 --- a/src/Symfony/Bundle/DoctrineMongoDBBundle/Tests/DependencyInjection/Fixtures/config/yml/full.yml +++ b/src/Symfony/Bundle/DoctrineMongoDBBundle/Tests/DependencyInjection/Fixtures/config/yml/full.yml @@ -26,7 +26,7 @@ doctrine_mongo_db: document_managers: dm1: mappings: - FooBundle: annotations + Foo: annotations metadata_cache_driver: type: memcache class: fooClass @@ -37,7 +37,7 @@ doctrine_mongo_db: connection: dm2_connection database: db1 mappings: - BarBundle: + Bar: type: yml dir: %kernel.cache_dir% prefix: prefix_val