1111
1212namespace Symfony \Cmf \Component \Testing \Tests \Functional ;
1313
14+ use Doctrine \Bundle \PHPCRBundle \Initializer \InitializerManager ;
15+ use Doctrine \Bundle \PHPCRBundle \ManagerRegistryInterface ;
1416use Doctrine \Bundle \PHPCRBundle \Test \RepositoryManager ;
1517use PHPUnit \Framework \MockObject \MockObject ;
1618use PHPUnit \Framework \TestCase ;
2527class BaseTestCaseTest extends TestCase
2628{
2729 /**
28- * @var ContainerInterface| MockObject
30+ * @var ContainerInterface& MockObject
2931 */
3032 private $ container ;
3133
3234 /**
33- * @var KernelInterface| MockObject
35+ * @var KernelInterface& MockObject
3436 */
3537 private $ kernel ;
3638
@@ -47,20 +49,24 @@ class BaseTestCaseTest extends TestCase
4749 protected function setUp (): void
4850 {
4951 $ this ->container = $ this ->createMock (ContainerInterface::class);
50- $ this ->container -> expects ( $ this -> any ())
52+ $ this ->container
5153 ->method ('get ' )
52- ->will ($ this ->returnCallback (function ($ name ) {
53- $ dic = ['test.client ' => $ this ->client ];
54+ ->willReturnCallback (function ($ name ) {
55+ $ dic = [
56+ 'test.client ' => $ this ->client ,
57+ 'doctrine_phpcr ' => $ this ->createMock (ManagerRegistryInterface::class),
58+ 'doctrine_phpcr.initializer_manager ' => $ this ->createMock (InitializerManager::class),
59+ ];
5460
5561 return $ dic [$ name ];
56- })) ;
62+ });
5763
5864 $ this ->kernel = $ this ->createMock (KernelInterface::class);
59- $ this ->kernel -> expects ( $ this -> any ())
65+ $ this ->kernel
6066 ->method ('getContainer ' )
6167 ->willReturn ($ this ->container )
6268 ;
63- $ this ->kernel -> expects ( $ this -> any ())
69+ $ this ->kernel
6470 ->method ('getEnvironment ' )
6571 ->willReturn ('phpcr ' )
6672 ;
@@ -74,7 +80,7 @@ protected function setUp(): void
7480 $ this ->client = $ this ->createMock (Client::class);
7581 }
7682
77- $ this ->client -> expects ( $ this -> any ())
83+ $ this ->client
7884 ->method ('getContainer ' )
7985 ->willReturn ($ this ->container );
8086 }
@@ -122,6 +128,7 @@ public function provideTestDb()
122128
123129 /**
124130 * @dataProvider provideTestDb
131+ *
125132 * @depends testGetContainer
126133 */
127134 public function testDb ($ dbName , $ expected )
0 commit comments