Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

[DoctrineMongoDBBundle] Added tag to document manager services

  • Loading branch information...
commit 87aeb0e6033da31dc759046148b2e3cc24cfabf0 1 parent 643c09a
@steves steves authored fabpot committed
View
1  src/Symfony/Bundle/DoctrineMongoDBBundle/DependencyInjection/DoctrineMongoDBExtension.php
@@ -160,6 +160,7 @@ protected function loadDocumentManager(array $documentManager, ContainerBuilder
);
$odmDmDef = new Definition('%doctrine.odm.mongodb.document_manager_class%', $odmDmArgs);
$odmDmDef->setFactoryMethod('create');
+ $odmDmDef->addTag('doctrine.odm.mongodb.document_manager');
$container->setDefinition(sprintf('doctrine.odm.mongodb.%s_document_manager', $documentManager['name']), $odmDmDef);
if ($documentManager['name'] == $defaultDocumentManager) {
View
6 ...y/Bundle/DoctrineMongoDBBundle/Tests/DependencyInjection/AbstractMongoDBExtensionTest.php
@@ -64,6 +64,7 @@ public function testDependencyInjectionConfigurationDefaults()
$definition = $container->getDefinition('doctrine.odm.mongodb.default_document_manager');
$this->assertEquals('%doctrine.odm.mongodb.document_manager_class%', $definition->getClass());
$this->assertEquals('create', $definition->getFactoryMethod());
+ $this->assertArrayHasKey('doctrine.odm.mongodb.document_manager', $definition->getTags());
$arguments = $definition->getArguments();
$this->assertInstanceOf('Symfony\Component\DependencyInjection\Reference', $arguments[0]);
@@ -90,6 +91,7 @@ public function testSingleDocumentManagerConfiguration()
$definition = $container->getDefinition('doctrine.odm.mongodb.default_document_manager');
$this->assertEquals('%doctrine.odm.mongodb.document_manager_class%', $definition->getClass());
$this->assertEquals('create', $definition->getFactoryMethod());
+ $this->assertArrayHasKey('doctrine.odm.mongodb.document_manager', $definition->getTags());
$arguments = $definition->getArguments();
$this->assertInstanceOf('Symfony\Component\DependencyInjection\Reference', $arguments[0]);
@@ -121,6 +123,7 @@ public function testLoadSimpleSingleConnection()
$definition = $container->getDefinition('doctrine.odm.mongodb.default_document_manager');
$this->assertEquals('%doctrine.odm.mongodb.document_manager_class%', $definition->getClass());
$this->assertEquals('create', $definition->getFactoryMethod());
+ $this->assertArrayHasKey('doctrine.odm.mongodb.document_manager', $definition->getTags());
$arguments = $definition->getArguments();
$this->assertInstanceOf('Symfony\Component\DependencyInjection\Reference', $arguments[0]);
@@ -146,6 +149,7 @@ public function testLoadSingleConnection()
$definition = $container->getDefinition('doctrine.odm.mongodb.default_document_manager');
$this->assertEquals('%doctrine.odm.mongodb.document_manager_class%', $definition->getClass());
$this->assertEquals('create', $definition->getFactoryMethod());
+ $this->assertArrayHasKey('doctrine.odm.mongodb.document_manager', $definition->getTags());
$arguments = $definition->getArguments();
$this->assertInstanceOf('Symfony\Component\DependencyInjection\Reference', $arguments[0]);
@@ -173,6 +177,7 @@ public function testLoadMultipleConnections()
$definition = $container->getDefinition('doctrine.odm.mongodb.dm1_document_manager');
$this->assertEquals('%doctrine.odm.mongodb.document_manager_class%', $definition->getClass());
$this->assertEquals('create', $definition->getFactoryMethod());
+ $this->assertArrayHasKey('doctrine.odm.mongodb.document_manager', $definition->getTags());
$arguments = $definition->getArguments();
$this->assertInstanceOf('Symfony\Component\DependencyInjection\Reference', $arguments[0]);
@@ -187,6 +192,7 @@ public function testLoadMultipleConnections()
$definition = $container->getDefinition('doctrine.odm.mongodb.dm2_document_manager');
$this->assertEquals('%doctrine.odm.mongodb.document_manager_class%', $definition->getClass());
$this->assertEquals('create', $definition->getFactoryMethod());
+ $this->assertArrayHasKey('doctrine.odm.mongodb.document_manager', $definition->getTags());
$arguments = $definition->getArguments();
$this->assertInstanceOf('Symfony\Component\DependencyInjection\Reference', $arguments[0]);
Please sign in to comment.
Something went wrong with that request. Please try again.