@@ -49,19 +49,19 @@ public function testCreate()
49
49
*/
50
50
public function testCreateExisting ()
51
51
{
52
- $ this ->session ->expects ($ this ->once ( ))
52
+ $ this ->session ->expects ($ this ->exactly ( 2 ))
53
53
->method ('getWorkspace ' )
54
54
->will ($ this ->returnValue ($ this ->workspace ))
55
55
;
56
- $ this ->session ->expects ($ this ->once ( ))
56
+ $ this ->session ->expects ($ this ->exactly ( 2 ))
57
57
->method ('getRepository ' )
58
58
->will ($ this ->returnValue ($ this ->repository ));
59
- $ this ->repository ->expects ($ this ->once ( ))
59
+ $ this ->repository ->expects ($ this ->exactly ( 2 ))
60
60
->method ('getDescriptor ' )
61
61
->with (RepositoryInterface::OPTION_WORKSPACE_MANAGEMENT_SUPPORTED )
62
62
->will ($ this ->returnValue (true ))
63
63
;
64
- $ this ->workspace ->expects ($ this ->once ( ))
64
+ $ this ->workspace ->expects ($ this ->exactly ( 2 ))
65
65
->method ('getAccessibleWorkspaceNames ' )
66
66
->will ($ this ->returnValue (array ('default ' , 'test ' )))
67
67
;
@@ -73,5 +73,16 @@ public function testCreateExisting()
73
73
);
74
74
75
75
$ this ->assertContains ('already has a workspace called "test" ' , $ tester ->getDisplay ());
76
+
77
+ $ tester = $ this ->executeCommand (
78
+ 'phpcr:workspace:create ' ,
79
+ array (
80
+ 'name ' => 'test ' ,
81
+ '--ignore-existing ' => true
82
+ ),
83
+ 0
84
+ );
85
+
86
+ $ this ->assertContains ('already has a workspace called "test" ' , $ tester ->getDisplay ());
76
87
}
77
88
}
0 commit comments