@@ -277,8 +277,14 @@ public function test_can_reset_default_manager()
277
277
$ this ->registry ->addManager ('default ' );
278
278
279
279
$ this ->container ->shouldReceive ('forgetInstance ' , 'doctrine.managers.default ' );
280
+ $ this ->container ->shouldReceive ('make ' )
281
+ ->with ('doctrine.managers.default ' )
282
+ ->andReturn (m::mock (\Doctrine \Common \Persistence \ObjectManager::class));
280
283
281
- $ this ->registry ->resetManager ();
284
+ $ manager = $ this ->registry ->resetManager ();
285
+
286
+ $ this ->assertInstanceOf (\Doctrine \Common \Persistence \ObjectManager::class, $ manager );
287
+ $ this ->assertSame ($ manager , $ this ->registry ->getManager ());
282
288
}
283
289
284
290
public function test_can_reset_custom_manager ()
@@ -287,8 +293,14 @@ public function test_can_reset_custom_manager()
287
293
$ this ->registry ->addManager ('custom ' );
288
294
289
295
$ this ->container ->shouldReceive ('forgetInstance ' , 'doctrine.managers.custom ' );
296
+ $ this ->container ->shouldReceive ('make ' )
297
+ ->with ('doctrine.managers.custom ' )
298
+ ->andReturn (m::mock (\Doctrine \Common \Persistence \ObjectManager::class));
299
+
300
+ $ manager = $ this ->registry ->resetManager ('custom ' );
290
301
291
- $ this ->registry ->resetManager ('custom ' );
302
+ $ this ->assertInstanceOf (\Doctrine \Common \Persistence \ObjectManager::class, $ manager );
303
+ $ this ->assertSame ($ manager , $ this ->registry ->getManager ('custom ' ));
292
304
}
293
305
294
306
public function test_cannot_reset_non_existing_managers ()
0 commit comments