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