@@ -20,7 +20,7 @@ class NodeTouchCommandTest extends BaseCommandTest
20
20
*/
21
21
public $ phpcrHelper ;
22
22
23
- public function setUp ()
23
+ public function setUp (): void
24
24
{
25
25
parent ::setUp ();
26
26
@@ -32,13 +32,13 @@ public function setUp()
32
32
->disableOriginalConstructor ()
33
33
->getMock ();
34
34
35
- $ this ->phpcrHelper -> expects ( $ this -> any ())
35
+ $ this ->phpcrHelper
36
36
->method ('getSession ' )
37
- ->will ($ this ->returnValue ( $ this -> session ) );
37
+ ->willReturn ($ this ->session );
38
38
39
- $ this ->phpcrHelper -> expects ( $ this -> any ())
39
+ $ this ->phpcrHelper
40
40
->method ('getName ' )
41
- ->will ( $ this -> returnValue ( 'phpcr ' ) );
41
+ ->willReturn ( 'phpcr ' );
42
42
43
43
$ this ->helperSet ->set ($ this ->phpcrHelper );
44
44
}
@@ -50,7 +50,7 @@ public function testTouch()
50
50
51
51
$ this ->session ->expects ($ this ->exactly (2 ))
52
52
->method ('getNode ' )
53
- ->will ( $ this -> returnCallback (function ($ path ) use ($ node ) {
53
+ ->willReturnCallback (function ($ path ) use ($ node ) {
54
54
switch ($ path ) {
55
55
case '/ ' :
56
56
return $ node ;
@@ -59,12 +59,12 @@ public function testTouch()
59
59
}
60
60
61
61
throw new Exception ('Unexpected ' .$ path );
62
- })) ;
62
+ });
63
63
64
64
$ this ->node1 ->expects ($ this ->once ())
65
65
->method ('addNode ' )
66
66
->with ('cms ' )
67
- ->will ( $ this -> returnValue ( $ child) );
67
+ ->willReturn ( $ child );
68
68
69
69
$ this ->session ->expects ($ this ->once ())
70
70
->method ('save ' );
@@ -77,31 +77,31 @@ public function testUpdate()
77
77
$ nodeType = $ this ->createMock (NodeTypeInterface::class);
78
78
$ nodeType ->expects ($ this ->once ())
79
79
->method ('getName ' )
80
- ->will ( $ this -> returnValue ( 'nt:unstructured ' ) );
80
+ ->willReturn ( 'nt:unstructured ' );
81
81
82
82
$ this ->session ->expects ($ this ->exactly (1 ))
83
83
->method ('getNode ' )
84
84
->with ('/cms ' )
85
- ->will ($ this ->returnValue ( $ this -> node1 ) );
85
+ ->willReturn ($ this ->node1 );
86
86
87
87
$ this ->node1 ->expects ($ this ->once ())
88
88
->method ('getPrimaryNodeType ' )
89
- ->will ( $ this -> returnValue ( $ nodeType) );
89
+ ->willReturn ( $ nodeType );
90
90
91
91
$ me = $ this ;
92
92
93
93
$ this ->phpcrHelper ->expects ($ this ->once ())
94
94
->method ('processNode ' )
95
- ->will ( $ this -> returnCallback (function ($ output , $ node , $ options ) use ($ me ) {
95
+ ->willReturnCallback (function ($ output , $ node , $ options ) use ($ me ) {
96
96
$ me ->assertEquals ($ me ->node1 , $ node );
97
97
$ me ->assertEquals ([
98
- 'setProp ' => ['foo=bar ' ],
99
- 'removeProp ' => ['bar ' ],
100
- 'addMixins ' => ['foo:bar ' ],
98
+ 'setProp ' => ['foo=bar ' ],
99
+ 'removeProp ' => ['bar ' ],
100
+ 'addMixins ' => ['foo:bar ' ],
101
101
'removeMixins ' => ['bar:foo ' ],
102
- 'dump ' => true ,
102
+ 'dump ' => true ,
103
103
], $ options );
104
- })) ;
104
+ });
105
105
106
106
$ this ->executeCommand ('phpcr:node:touch ' , [
107
107
'path ' => '/cms ' ,
0 commit comments