11
11
12
12
namespace Symfony \Cmf \Component \Testing \Tests \Functional ;
13
13
14
+ use Doctrine \Bundle \PHPCRBundle \Initializer \InitializerManager ;
15
+ use Doctrine \Bundle \PHPCRBundle \ManagerRegistryInterface ;
14
16
use Doctrine \Bundle \PHPCRBundle \Test \RepositoryManager ;
15
17
use PHPUnit \Framework \MockObject \MockObject ;
16
18
use PHPUnit \Framework \TestCase ;
25
27
class BaseTestCaseTest extends TestCase
26
28
{
27
29
/**
28
- * @var ContainerInterface| MockObject
30
+ * @var ContainerInterface& MockObject
29
31
*/
30
32
private $ container ;
31
33
32
34
/**
33
- * @var KernelInterface| MockObject
35
+ * @var KernelInterface& MockObject
34
36
*/
35
37
private $ kernel ;
36
38
@@ -47,20 +49,24 @@ class BaseTestCaseTest extends TestCase
47
49
protected function setUp (): void
48
50
{
49
51
$ this ->container = $ this ->createMock (ContainerInterface::class);
50
- $ this ->container -> expects ( $ this -> any ())
52
+ $ this ->container
51
53
->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
+ ];
54
60
55
61
return $ dic [$ name ];
56
- })) ;
62
+ });
57
63
58
64
$ this ->kernel = $ this ->createMock (KernelInterface::class);
59
- $ this ->kernel -> expects ( $ this -> any ())
65
+ $ this ->kernel
60
66
->method ('getContainer ' )
61
67
->willReturn ($ this ->container )
62
68
;
63
- $ this ->kernel -> expects ( $ this -> any ())
69
+ $ this ->kernel
64
70
->method ('getEnvironment ' )
65
71
->willReturn ('phpcr ' )
66
72
;
@@ -74,7 +80,7 @@ protected function setUp(): void
74
80
$ this ->client = $ this ->createMock (Client::class);
75
81
}
76
82
77
- $ this ->client -> expects ( $ this -> any ())
83
+ $ this ->client
78
84
->method ('getContainer ' )
79
85
->willReturn ($ this ->container );
80
86
}
@@ -122,6 +128,7 @@ public function provideTestDb()
122
128
123
129
/**
124
130
* @dataProvider provideTestDb
131
+ *
125
132
* @depends testGetContainer
126
133
*/
127
134
public function testDb ($ dbName , $ expected )
0 commit comments