@@ -49,19 +49,19 @@ public function testCreate()
4949 */
5050 public function testCreateExisting ()
5151 {
52- $ this ->session ->expects ($ this ->once ( ))
52+ $ this ->session ->expects ($ this ->exactly ( 2 ))
5353 ->method ('getWorkspace ' )
5454 ->will ($ this ->returnValue ($ this ->workspace ))
5555 ;
56- $ this ->session ->expects ($ this ->once ( ))
56+ $ this ->session ->expects ($ this ->exactly ( 2 ))
5757 ->method ('getRepository ' )
5858 ->will ($ this ->returnValue ($ this ->repository ));
59- $ this ->repository ->expects ($ this ->once ( ))
59+ $ this ->repository ->expects ($ this ->exactly ( 2 ))
6060 ->method ('getDescriptor ' )
6161 ->with (RepositoryInterface::OPTION_WORKSPACE_MANAGEMENT_SUPPORTED )
6262 ->will ($ this ->returnValue (true ))
6363 ;
64- $ this ->workspace ->expects ($ this ->once ( ))
64+ $ this ->workspace ->expects ($ this ->exactly ( 2 ))
6565 ->method ('getAccessibleWorkspaceNames ' )
6666 ->will ($ this ->returnValue (array ('default ' , 'test ' )))
6767 ;
@@ -73,5 +73,16 @@ public function testCreateExisting()
7373 );
7474
7575 $ 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 ());
7687 }
7788}
0 commit comments