Permalink
Browse files

[DoctrineMongoDBBundle] Added tag to document manager services

  • Loading branch information...
steves authored and fabpot committed Nov 20, 2010
1 parent 643c09a commit 87aeb0e6033da31dc759046148b2e3cc24cfabf0
@@ -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) {
@@ -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]);

0 comments on commit 87aeb0e

Please sign in to comment.