@@ -29,7 +29,6 @@ class IlluminateRegistryTest extends PHPUnit_Framework_TestCase
29
29
protected function setUp ()
30
30
{
31
31
$ this ->container = m::mock (Container::class);
32
- $ this ->container ->shouldReceive ('bound ' )->andReturn (false );
33
32
$ this ->factory = m::mock (EntityManagerFactory::class);
34
33
35
34
$ this ->registry = new IlluminateRegistry (
@@ -40,7 +39,7 @@ protected function setUp()
40
39
41
40
public function test_can_add_manager ()
42
41
{
43
- $ this ->container ->shouldReceive ('singleton ' )->once ();
42
+ $ this ->container ->shouldReceive ('singleton ' )->twice ();
44
43
$ this ->registry ->addManager ('default ' , ['settings ' ]);
45
44
46
45
$ this ->assertTrue ($ this ->registry ->managerExists ('default ' ));
@@ -70,7 +69,7 @@ public function test_get_default_connection_name()
70
69
public function test_get_default_manager_name ()
71
70
{
72
71
// Will return first, when no default name
73
- $ this ->container ->shouldReceive ('singleton ' )->once ( );
72
+ $ this ->container ->shouldReceive ('singleton ' )->times ( 3 );
74
73
$ this ->registry ->addManager ('custom ' );
75
74
$ this ->assertEquals ('custom ' , $ this ->registry ->getDefaultManagerName ());
76
75
@@ -178,7 +177,7 @@ public function test_can_get_all_connections()
178
177
179
178
public function test_can_get_default_manager ()
180
179
{
181
- $ this ->container ->shouldReceive ('singleton ' )->once ( );
180
+ $ this ->container ->shouldReceive ('singleton ' )->times ( 2 );
182
181
$ this ->registry ->addManager ('default ' );
183
182
184
183
$ this ->container ->shouldReceive ('make ' )
@@ -191,7 +190,7 @@ public function test_can_get_default_manager()
191
190
192
191
public function test_can_get_custom_manager ()
193
192
{
194
- $ this ->container ->shouldReceive ('singleton ' )->once ( );
193
+ $ this ->container ->shouldReceive ('singleton ' )->times ( 2 );
195
194
$ this ->registry ->addManager ('custom ' );
196
195
197
196
$ this ->container ->shouldReceive ('make ' )
@@ -213,7 +212,7 @@ public function test_cannot_non_existing_manager()
213
212
214
213
public function test_manager_gets_only_resolved_once ()
215
214
{
216
- $ this ->container ->shouldReceive ('singleton ' )->once ( );
215
+ $ this ->container ->shouldReceive ('singleton ' )->times ( 2 );
217
216
$ this ->registry ->addManager ('default ' );
218
217
219
218
$ this ->container ->shouldReceive ('make ' )
@@ -231,7 +230,7 @@ public function test_manager_gets_only_resolved_once()
231
230
232
231
public function test_can_check_if_manager_exists ()
233
232
{
234
- $ this ->container ->shouldReceive ('singleton ' )->once ( );
233
+ $ this ->container ->shouldReceive ('singleton ' )->times ( 2 );
235
234
$ this ->registry ->addManager ('default ' );
236
235
237
236
$ this ->assertFalse ($ this ->registry ->managerExists ('non-existing ' ));
@@ -240,7 +239,7 @@ public function test_can_check_if_manager_exists()
240
239
241
240
public function test_can_get_manager_names ()
242
241
{
243
- $ this ->container ->shouldReceive ('singleton ' )->twice ( );
242
+ $ this ->container ->shouldReceive ('singleton ' )->times ( 4 );
244
243
245
244
$ this ->registry ->addManager ('default ' );
246
245
$ this ->registry ->addManager ('custom ' );
@@ -252,7 +251,7 @@ public function test_can_get_manager_names()
252
251
253
252
public function test_can_get_all_managers ()
254
253
{
255
- $ this ->container ->shouldReceive ('singleton ' )->twice ( );
254
+ $ this ->container ->shouldReceive ('singleton ' )->times ( 4 );
256
255
257
256
$ this ->container ->shouldReceive ('make ' )
258
257
->with ('doctrine.managers.default ' )
@@ -302,7 +301,7 @@ public function test_cannot_reset_non_existing_managers()
302
301
$ this ->registry ->resetManager ('non-existing ' );
303
302
}
304
303
305
- public function test_get_alias_namespace_from_unkown_namespace ()
304
+ public function test_get_alias_namespace_from_unknown_namespace ()
306
305
{
307
306
$ this ->setExpectedException (
308
307
ORMException::class,
0 commit comments