|
@@ -70,8 +70,9 @@ abstract class AbstractMongoDBExtensionTest extends TestCase
|
|
$arguments = $definition->getArguments();
|
|
$arguments = $definition->getArguments();
|
|
$this->assertInstanceOf('Symfony\Component\DependencyInjection\Reference', $arguments[0]);
|
|
$this->assertInstanceOf('Symfony\Component\DependencyInjection\Reference', $arguments[0]);
|
|
$this->assertEquals('doctrine.odm.mongodb.default_connection', (string) $arguments[0]);
|
|
$this->assertEquals('doctrine.odm.mongodb.default_connection', (string) $arguments[0]);
|
|
- $this->assertInstanceOf('Symfony\Component\DependencyInjection\Reference', $arguments[1]);
|
|
|
|
- $this->assertEquals('doctrine.odm.mongodb.default_configuration', (string) $arguments[1]);
|
|
|
|
|
|
+ $this->assertEquals('default', $arguments[1]);
|
|
|
|
+ $this->assertInstanceOf('Symfony\Component\DependencyInjection\Reference', $arguments[2]);
|
|
|
|
+ $this->assertEquals('doctrine.odm.mongodb.default_configuration', (string) $arguments[2]);
|
|
}
|
|
}
|
|
|
|
|
|
public function testSingleDocumentManagerConfiguration()
|
|
public function testSingleDocumentManagerConfiguration()
|
|
@@ -81,7 +82,8 @@ abstract class AbstractMongoDBExtensionTest extends TestCase
|
|
|
|
|
|
$config = array(
|
|
$config = array(
|
|
'server' => 'mongodb://localhost:27017',
|
|
'server' => 'mongodb://localhost:27017',
|
|
- 'options' => array('connect' => true)
|
|
|
|
|
|
+ 'options' => array('connect' => true),
|
|
|
|
+ 'default_database' => 'test'
|
|
);
|
|
);
|
|
$loader->mongodbLoad(array($config), $container);
|
|
$loader->mongodbLoad(array($config), $container);
|
|
|
|
|
|
@@ -98,8 +100,9 @@ abstract class AbstractMongoDBExtensionTest extends TestCase
|
|
$arguments = $definition->getArguments();
|
|
$arguments = $definition->getArguments();
|
|
$this->assertInstanceOf('Symfony\Component\DependencyInjection\Reference', $arguments[0]);
|
|
$this->assertInstanceOf('Symfony\Component\DependencyInjection\Reference', $arguments[0]);
|
|
$this->assertEquals('doctrine.odm.mongodb.default_connection', (string) $arguments[0]);
|
|
$this->assertEquals('doctrine.odm.mongodb.default_connection', (string) $arguments[0]);
|
|
- $this->assertInstanceOf('Symfony\Component\DependencyInjection\Reference', $arguments[1]);
|
|
|
|
- $this->assertEquals('doctrine.odm.mongodb.default_configuration', (string) $arguments[1]);
|
|
|
|
|
|
+ $this->assertEquals('test', $arguments[1]);
|
|
|
|
+ $this->assertInstanceOf('Symfony\Component\DependencyInjection\Reference', $arguments[2]);
|
|
|
|
+ $this->assertEquals('doctrine.odm.mongodb.default_configuration', (string) $arguments[2]);
|
|
}
|
|
}
|
|
|
|
|
|
public function testLoadSimpleSingleConnection()
|
|
public function testLoadSimpleSingleConnection()
|
|
@@ -133,8 +136,9 @@ abstract class AbstractMongoDBExtensionTest extends TestCase
|
|
$arguments = $definition->getArguments();
|
|
$arguments = $definition->getArguments();
|
|
$this->assertInstanceOf('Symfony\Component\DependencyInjection\Reference', $arguments[0]);
|
|
$this->assertInstanceOf('Symfony\Component\DependencyInjection\Reference', $arguments[0]);
|
|
$this->assertEquals('doctrine.odm.mongodb.default_connection', (string) $arguments[0]);
|
|
$this->assertEquals('doctrine.odm.mongodb.default_connection', (string) $arguments[0]);
|
|
- $this->assertInstanceOf('Symfony\Component\DependencyInjection\Reference', $arguments[1]);
|
|
|
|
- $this->assertEquals('doctrine.odm.mongodb.default_configuration', (string) $arguments[1]);
|
|
|
|
|
|
+ $this->assertEquals('mydb', $arguments[1]);
|
|
|
|
+ $this->assertInstanceOf('Symfony\Component\DependencyInjection\Reference', $arguments[2]);
|
|
|
|
+ $this->assertEquals('doctrine.odm.mongodb.default_configuration', (string) $arguments[2]);
|
|
}
|
|
}
|
|
|
|
|
|
public function testLoadSingleConnection()
|
|
public function testLoadSingleConnection()
|
|
@@ -162,8 +166,9 @@ abstract class AbstractMongoDBExtensionTest extends TestCase
|
|
$arguments = $definition->getArguments();
|
|
$arguments = $definition->getArguments();
|
|
$this->assertInstanceOf('Symfony\Component\DependencyInjection\Reference', $arguments[0]);
|
|
$this->assertInstanceOf('Symfony\Component\DependencyInjection\Reference', $arguments[0]);
|
|
$this->assertEquals('doctrine.odm.mongodb.default_connection', (string) $arguments[0]);
|
|
$this->assertEquals('doctrine.odm.mongodb.default_connection', (string) $arguments[0]);
|
|
- $this->assertInstanceOf('Symfony\Component\DependencyInjection\Reference', $arguments[1]);
|
|
|
|
- $this->assertEquals('doctrine.odm.mongodb.default_configuration', (string) $arguments[1]);
|
|
|
|
|
|
+ $this->assertEquals('default', $arguments[1]);
|
|
|
|
+ $this->assertInstanceOf('Symfony\Component\DependencyInjection\Reference', $arguments[2]);
|
|
|
|
+ $this->assertEquals('doctrine.odm.mongodb.default_configuration', (string) $arguments[2]);
|
|
}
|
|
}
|
|
|
|
|
|
public function testLoadMultipleConnections()
|
|
public function testLoadMultipleConnections()
|
|
@@ -193,8 +198,9 @@ abstract class AbstractMongoDBExtensionTest extends TestCase
|
|
$arguments = $definition->getArguments();
|
|
$arguments = $definition->getArguments();
|
|
$this->assertInstanceOf('Symfony\Component\DependencyInjection\Reference', $arguments[0]);
|
|
$this->assertInstanceOf('Symfony\Component\DependencyInjection\Reference', $arguments[0]);
|
|
$this->assertEquals('doctrine.odm.mongodb.conn1_connection', (string) $arguments[0]);
|
|
$this->assertEquals('doctrine.odm.mongodb.conn1_connection', (string) $arguments[0]);
|
|
- $this->assertInstanceOf('Symfony\Component\DependencyInjection\Reference', $arguments[1]);
|
|
|
|
- $this->assertEquals('doctrine.odm.mongodb.dm1_configuration', (string) $arguments[1]);
|
|
|
|
|
|
+ $this->assertEquals('default', $arguments[1]);
|
|
|
|
+ $this->assertInstanceOf('Symfony\Component\DependencyInjection\Reference', $arguments[2]);
|
|
|
|
+ $this->assertEquals('doctrine.odm.mongodb.dm1_configuration', (string) $arguments[2]);
|
|
|
|
|
|
$definition = $container->getDefinition('doctrine.odm.mongodb.conn2_connection');
|
|
$definition = $container->getDefinition('doctrine.odm.mongodb.conn2_connection');
|
|
$this->assertEquals('%doctrine.odm.mongodb.connection_class%', $definition->getClass());
|
|
$this->assertEquals('%doctrine.odm.mongodb.connection_class%', $definition->getClass());
|
|
@@ -209,8 +215,9 @@ abstract class AbstractMongoDBExtensionTest extends TestCase
|
|
$arguments = $definition->getArguments();
|
|
$arguments = $definition->getArguments();
|
|
$this->assertInstanceOf('Symfony\Component\DependencyInjection\Reference', $arguments[0]);
|
|
$this->assertInstanceOf('Symfony\Component\DependencyInjection\Reference', $arguments[0]);
|
|
$this->assertEquals('doctrine.odm.mongodb.conn2_connection', (string) $arguments[0]);
|
|
$this->assertEquals('doctrine.odm.mongodb.conn2_connection', (string) $arguments[0]);
|
|
- $this->assertInstanceOf('Symfony\Component\DependencyInjection\Reference', $arguments[1]);
|
|
|
|
- $this->assertEquals('doctrine.odm.mongodb.dm2_configuration', (string) $arguments[1]);
|
|
|
|
|
|
+ $this->assertEquals('prod2', $arguments[1]);
|
|
|
|
+ $this->assertInstanceOf('Symfony\Component\DependencyInjection\Reference', $arguments[2]);
|
|
|
|
+ $this->assertEquals('doctrine.odm.mongodb.dm2_configuration', (string) $arguments[2]);
|
|
}
|
|
}
|
|
|
|
|
|
public function testBundleDocumentAliases()
|
|
public function testBundleDocumentAliases()
|