File tree Expand file tree Collapse file tree 2 files changed +20
-4
lines changed
tests/Integration/WorkspaceMgmt Expand file tree Collapse file tree 2 files changed +20
-4
lines changed Original file line number Diff line number Diff line change @@ -157,14 +157,22 @@ private function createTestWorkspace(): Workspace
157157
158158 // Move test repo to the workspace root location
159159 if (!is_dir ($ this ->workspaceRoot )) {
160- mkdir ($ this ->workspaceRoot , 0777 , true );
160+ $ result = mkdir ($ this ->workspaceRoot , 0777 , true );
161+ if (!$ result ) {
162+ throw new \RuntimeException ('Failed to create workspace root directory: ' . $ this ->workspaceRoot );
163+ }
161164 }
162165
163166 $ targetPath = $ this ->workspaceRoot . '/ ' . $ workspaceId ;
164167 if (is_dir ($ targetPath )) {
165168 $ this ->removeDirectory ($ targetPath );
166169 }
167- rename ($ this ->testRepoPath , $ targetPath );
170+
171+ $ renameResult = rename ($ this ->testRepoPath , $ targetPath );
172+ if (!$ renameResult ) {
173+ throw new \RuntimeException ('Failed to rename ' . $ this ->testRepoPath . ' to ' . $ targetPath );
174+ }
175+
168176 $ this ->testRepoPath = $ targetPath ;
169177
170178 return $ workspace ;
Original file line number Diff line number Diff line change @@ -214,14 +214,22 @@ private function createTestWorkspace(): Workspace
214214
215215 // Move test repo to the workspace root location
216216 if (!is_dir ($ this ->workspaceRoot )) {
217- mkdir ($ this ->workspaceRoot , 0777 , true );
217+ $ result = mkdir ($ this ->workspaceRoot , 0777 , true );
218+ if (!$ result ) {
219+ throw new \RuntimeException ('Failed to create workspace root directory: ' . $ this ->workspaceRoot );
220+ }
218221 }
219222
220223 $ targetPath = $ this ->workspaceRoot . '/ ' . $ workspaceId ;
221224 if (is_dir ($ targetPath )) {
222225 $ this ->removeDirectory ($ targetPath );
223226 }
224- rename ($ this ->testRepoPath , $ targetPath );
227+
228+ $ renameResult = rename ($ this ->testRepoPath , $ targetPath );
229+ if (!$ renameResult ) {
230+ throw new \RuntimeException ('Failed to rename ' . $ this ->testRepoPath . ' to ' . $ targetPath );
231+ }
232+
225233 $ this ->testRepoPath = $ targetPath ;
226234
227235 return $ workspace ;
You can’t perform that action at this time.
0 commit comments