21
21
22
22
class CmfHierarchyTest extends BaseTestCase
23
23
{
24
- /**
25
- * @var AuthorizationCheckerInterface|MockObject
26
- */
27
- private $ publishWorkflowChecker ;
28
-
29
- /**
30
- * @var Cmf
31
- */
32
- private $ helper ;
24
+ private MockObject &AuthorizationCheckerInterface $ publishWorkflowChecker ;
25
+ private Cmf $ helper ;
33
26
34
27
public function setUp (): void
35
28
{
@@ -39,14 +32,14 @@ public function setUp(): void
39
32
$ this ->publishWorkflowChecker = $ this ->createMock (AuthorizationCheckerInterface::class);
40
33
$ this ->publishWorkflowChecker
41
34
->method ('isGranted ' )
42
- ->will ( $ this -> returnValue ( true ) )
35
+ ->willReturn ( true )
43
36
;
44
37
45
38
$ this ->helper = new Cmf ($ this ->publishWorkflowChecker );
46
39
$ this ->helper ->setDoctrineRegistry ($ dbManager ->getRegistry (), 'default ' );
47
40
}
48
41
49
- public function testGetDescendants ()
42
+ public function testGetDescendants (): void
50
43
{
51
44
$ this ->assertEquals ([], $ this ->helper ->getDescendants (null ));
52
45
@@ -60,7 +53,7 @@ public function testGetDescendants()
60
53
/**
61
54
* @dataProvider getPrevData
62
55
*/
63
- public function testGetPrev ($ expected , $ path , $ anchor = null , $ depth = null , $ class = ' Doctrine\ODM\PHPCR\Document\ Generic' )
56
+ public function testGetPrev (? string $ expected , ? string $ path , ? string $ anchor = null , ? int $ depth = null , string $ class = Generic::class): void
64
57
{
65
58
$ prev = $ this ->helper ->getPrev ($ path , $ anchor , $ depth );
66
59
if (null === $ expected ) {
@@ -71,7 +64,7 @@ public function testGetPrev($expected, $path, $anchor = null, $depth = null, $cl
71
64
}
72
65
}
73
66
74
- public static function getPrevData ()
67
+ public static function getPrevData (): array
75
68
{
76
69
return [
77
70
[null , null ],
@@ -99,7 +92,7 @@ public static function getPrevData()
99
92
/**
100
93
* @dataProvider getNextData
101
94
*/
102
- public function testGetNext ($ expected , $ path , $ anchor = null , $ depth = null , $ class = Generic::class)
95
+ public function testGetNext (? string $ expected , ? string $ path , ? string $ anchor = null , ? int $ depth = null , string $ class = Generic::class): void
103
96
{
104
97
$ next = $ this ->helper ->getNext ($ path , $ anchor , $ depth );
105
98
if (null === $ expected ) {
@@ -110,7 +103,7 @@ public function testGetNext($expected, $path, $anchor = null, $depth = null, $cl
110
103
}
111
104
}
112
105
113
- public static function getNextData ()
106
+ public static function getNextData (): array
114
107
{
115
108
return [
116
109
[null , null ],
@@ -139,7 +132,7 @@ public static function getNextData()
139
132
/**
140
133
* @dataProvider getPrevLinkableData
141
134
*/
142
- public function testGetPrevLinkable ($ expected , $ path , $ anchor = null , $ depth = null )
135
+ public function testGetPrevLinkable (? string $ expected , ? string $ path , ? string $ anchor = null , ? int $ depth = null ): void
143
136
{
144
137
$ prev = $ this ->helper ->getPrevLinkable ($ path , $ anchor , $ depth );
145
138
if (null === $ expected ) {
@@ -150,7 +143,7 @@ public function testGetPrevLinkable($expected, $path, $anchor = null, $depth = n
150
143
}
151
144
}
152
145
153
- public static function getPrevLinkableData ()
146
+ public static function getPrevLinkableData (): array
154
147
{
155
148
// TODO: expand test case
156
149
return [
@@ -164,7 +157,7 @@ public static function getPrevLinkableData()
164
157
/**
165
158
* @dataProvider getNextLinkableData
166
159
*/
167
- public function testGetNextLinkable ($ expected , $ path , $ anchor = null , $ depth = null )
160
+ public function testGetNextLinkable (? string $ expected , ? string $ path , ? string $ anchor = null , ? int $ depth = null ): void
168
161
{
169
162
$ next = $ this ->helper ->getNextLinkable ($ path , $ anchor , $ depth );
170
163
if (null === $ expected ) {
@@ -175,7 +168,7 @@ public function testGetNextLinkable($expected, $path, $anchor = null, $depth = n
175
168
}
176
169
}
177
170
178
- public static function getNextLinkableData ()
171
+ public static function getNextLinkableData (): array
179
172
{
180
173
// TODO: expand test case
181
174
return [
0 commit comments