@@ -22,13 +22,14 @@ protected function setUp()
2222 {
2323 $ this ->processExecutor = Phony::mock ('Composer\Util\ProcessExecutor ' );
2424 $ this ->executableFinder = Phony::mock ('Symfony\Component\Process\ExecutableFinder ' );
25- $ this ->isolator = Phony::mock ('Icecave\Isolator\Isolator ' );
25+ $ this ->getcwd = Phony::stub ();
26+ $ this ->chdir = Phony::stub ();
2627 $ this ->client =
27- new NpmClient ($ this ->processExecutor ->mock (), $ this ->executableFinder ->mock (), $ this ->isolator -> mock () );
28+ new NpmClient ($ this ->processExecutor ->mock (), $ this ->executableFinder ->mock (), $ this ->getcwd , $ this -> chdir );
2829
29- $ this ->executableFinder ->find ('npm ' )->returns ('/path/to/npm ' );
30- $ this ->isolator ->getcwd ()->returns ('/path/to/cwd ' );
3130 $ this ->processExecutor ->execute ('* ' )->returns (0 );
31+ $ this ->executableFinder ->find ('npm ' )->returns ('/path/to/npm ' );
32+ $ this ->getcwd ->returns ('/path/to/cwd ' );
3233 }
3334
3435 public function testInstall ()
@@ -37,12 +38,12 @@ public function testInstall()
3738 $ this ->assertNull ($ this ->client ->install ('/path/to/project ' ));
3839 Phony::inOrder (
3940 $ this ->executableFinder ->find ->calledWith ('npm ' ),
40- $ this ->isolator -> chdir ->calledWith ('/path/to/project ' ),
41+ $ this ->chdir ->calledWith ('/path/to/project ' ),
4142 $ this ->processExecutor ->execute ->calledWith ("'/path/to/npm' 'install' " ),
42- $ this ->isolator -> chdir ->calledWith ('/path/to/cwd ' ),
43- $ this ->isolator -> chdir ->calledWith ('/path/to/project ' ),
43+ $ this ->chdir ->calledWith ('/path/to/cwd ' ),
44+ $ this ->chdir ->calledWith ('/path/to/project ' ),
4445 $ this ->processExecutor ->execute ->calledWith ("'/path/to/npm' 'install' " ),
45- $ this ->isolator -> chdir ->calledWith ('/path/to/cwd ' )
46+ $ this ->chdir ->calledWith ('/path/to/cwd ' )
4647 );
4748 }
4849
@@ -51,9 +52,9 @@ public function testInstallProductionMode()
5152 $ this ->assertNull ($ this ->client ->install ('/path/to/project ' , false ));
5253 Phony::inOrder (
5354 $ this ->executableFinder ->find ->calledWith ('npm ' ),
54- $ this ->isolator -> chdir ->calledWith ('/path/to/project ' ),
55+ $ this ->chdir ->calledWith ('/path/to/project ' ),
5556 $ this ->processExecutor ->execute ->calledWith ("'/path/to/npm' 'install' '--production' " ),
56- $ this ->isolator -> chdir ->calledWith ('/path/to/cwd ' )
57+ $ this ->chdir ->calledWith ('/path/to/cwd ' )
5758 );
5859 }
5960
@@ -79,12 +80,12 @@ public function testUpdate()
7980 $ this ->assertNull ($ this ->client ->update ('/path/to/project ' ));
8081 Phony::inOrder (
8182 $ this ->executableFinder ->find ->calledWith ('npm ' ),
82- $ this ->isolator -> chdir ->calledWith ('/path/to/project ' ),
83+ $ this ->chdir ->calledWith ('/path/to/project ' ),
8384 $ this ->processExecutor ->execute ->calledWith ("'/path/to/npm' 'update' " ),
84- $ this ->isolator -> chdir ->calledWith ('/path/to/cwd ' ),
85- $ this ->isolator -> chdir ->calledWith ('/path/to/project ' ),
85+ $ this ->chdir ->calledWith ('/path/to/cwd ' ),
86+ $ this ->chdir ->calledWith ('/path/to/project ' ),
8687 $ this ->processExecutor ->execute ->calledWith ("'/path/to/npm' 'update' " ),
87- $ this ->isolator -> chdir ->calledWith ('/path/to/cwd ' )
88+ $ this ->chdir ->calledWith ('/path/to/cwd ' )
8889 );
8990 }
9091
@@ -110,12 +111,12 @@ public function testShrinkwrap()
110111 $ this ->assertNull ($ this ->client ->shrinkwrap ('/path/to/project ' ));
111112 Phony::inOrder (
112113 $ this ->executableFinder ->find ->calledWith ('npm ' ),
113- $ this ->isolator -> chdir ->calledWith ('/path/to/project ' ),
114+ $ this ->chdir ->calledWith ('/path/to/project ' ),
114115 $ this ->processExecutor ->execute ->calledWith ("'/path/to/npm' 'shrinkwrap' " ),
115- $ this ->isolator -> chdir ->calledWith ('/path/to/cwd ' ),
116- $ this ->isolator -> chdir ->calledWith ('/path/to/project ' ),
116+ $ this ->chdir ->calledWith ('/path/to/cwd ' ),
117+ $ this ->chdir ->calledWith ('/path/to/project ' ),
117118 $ this ->processExecutor ->execute ->calledWith ("'/path/to/npm' 'shrinkwrap' " ),
118- $ this ->isolator -> chdir ->calledWith ('/path/to/cwd ' )
119+ $ this ->chdir ->calledWith ('/path/to/cwd ' )
119120 );
120121 }
121122
0 commit comments