@@ -69,7 +69,7 @@ public function testRun()
6969 shell_exec ('git commit --file=message.txt 2>&1 ' );
7070 preg_match ('/^commit (\S+)/ ' , shell_exec ('git log -n 1 ' ), $ match );
7171 $ hash2 = $ match [1 ];
72- shell_exec ("git checkout $ hash2 " );
72+ shell_exec ("git checkout $ hash2 2>&1 " );
7373
7474 chdir ($ directory1 );
7575
@@ -97,7 +97,9 @@ public function testRun()
9797 'vendor/package ' ,
9898 '#[1;35mBuild vendor/sub-package ' ,
9999 "#[0m#[1;32mgit clone $ directory2 {$ path }dist/vendor/sub-package " ,
100- "#[0m#[1;30m#[0m#[1;34mcd {$ path }dist/vendor/sub-package " ,
100+ "#[0m#[1;30mCloning into ' {$ path }dist/vendor/sub-package'... " ,
101+ 'done. ' ,
102+ "#[0m#[1;34mcd {$ path }dist/vendor/sub-package " ,
101103 '#[0m#[1;32mgit checkout master ' ,
102104 "#[0m#[1;30m#[0m#[1;35mBuild distributed in {$ path }dist " ,
103105 '#[0m ' ,
@@ -115,20 +117,29 @@ public function testRun()
115117 */
116118 public function testErrors ()
117119 {
120+ $ cwd = getcwd ();
118121 $ cli = new Split ();
119122 $ cli ->setEscapeCharacter ('# ' );
120123
121124 $ dist = new Dist ();
122125
126+ $ directory = sys_get_temp_dir ().'/split-test- ' .mt_rand (0 , 9999999 );
127+ FileSystem::createDir ($ directory );
128+ $ directory = realpath ($ directory );
129+ chdir ($ directory );
130+
123131 ob_start ();
124132 $ return = $ dist ->run ($ cli );
125133 $ output = ob_get_contents ();
126134 ob_end_clean ();
127135
136+ @shell_exec ('rm -rf ' . escapeshellarg ($ directory ) . ' 2>&1 ' );
137+ file_exists ($ directory ) && @shell_exec ('rmdir /S /Q ' . escapeshellarg ($ directory ) . ' 2>&1 ' );
138+ @FileSystem::delete ($ directory );
139+
128140 $ this ->assertSame ("#[0;31mRoot project directory should contains a composer.json file. \n#[0m " , $ output );
129141 $ this ->assertFalse ($ return );
130142
131- $ cwd = getcwd ();
132143 $ dist = new Dist ();
133144
134145 $ directory = sys_get_temp_dir ().'/split-test- ' .mt_rand (0 , 9999999 );
0 commit comments