@@ 82-94 (lines=13) @@ | ||
79 | $this->assertEquals(array('default' => 'doctrine.dbal.default_connection'), $registry->getConnectionNames()); |
|
80 | } |
|
81 | ||
82 | public function testGetDefaultEntityManager() |
|
83 | { |
|
84 | $em = new \stdClass(); |
|
85 | $container = $this->getMock('Symfony\Component\DependencyInjection\ContainerInterface'); |
|
86 | $container->expects($this->once()) |
|
87 | ->method('get') |
|
88 | ->with($this->equalTo('doctrine.orm.default_entity_manager')) |
|
89 | ->will($this->returnValue($em)); |
|
90 | ||
91 | $registry = new Registry($container, array(), array('default' => 'doctrine.orm.default_entity_manager'), 'default', 'default'); |
|
92 | ||
93 | $this->assertSame($em, $registry->getManager()); |
|
94 | } |
|
95 | ||
96 | public function testGetEntityManager() |
|
97 | { |
|
@@ 96-108 (lines=13) @@ | ||
93 | $this->assertSame($em, $registry->getManager()); |
|
94 | } |
|
95 | ||
96 | public function testGetEntityManager() |
|
97 | { |
|
98 | $em = new \stdClass(); |
|
99 | $container = $this->getMock('Symfony\Component\DependencyInjection\ContainerInterface'); |
|
100 | $container->expects($this->once()) |
|
101 | ->method('get') |
|
102 | ->with($this->equalTo('doctrine.orm.default_entity_manager')) |
|
103 | ->will($this->returnValue($em)); |
|
104 | ||
105 | $registry = new Registry($container, array(), array('default' => 'doctrine.orm.default_entity_manager'), 'default', 'default'); |
|
106 | ||
107 | $this->assertSame($em, $registry->getManager('default')); |
|
108 | } |
|
109 | ||
110 | public function testGetUnknownEntityManager() |
|
111 | { |