@@ -281,7 +281,7 @@ public function testRemoveCleansFilesAndDirectoriesIteratively()
281
281
282
282
$ this ->filesystem ->remove ($ basePath );
283
283
284
- $ this ->assertTrue (! is_dir ( $ basePath) );
284
+ $ this ->assertFileNotExists ( $ basePath );
285
285
}
286
286
287
287
public function testRemoveCleansArrayOfFilesAndDirectories ()
@@ -297,8 +297,8 @@ public function testRemoveCleansArrayOfFilesAndDirectories()
297
297
298
298
$ this ->filesystem ->remove ($ files );
299
299
300
- $ this ->assertTrue (! is_dir ( $ basePath .'dir ' ) );
301
- $ this ->assertTrue (! is_file ( $ basePath .'file ' ) );
300
+ $ this ->assertFileNotExists ( $ basePath .'dir ' );
301
+ $ this ->assertFileNotExists ( $ basePath .'file ' );
302
302
}
303
303
304
304
public function testRemoveCleansTraversableObjectOfFilesAndDirectories ()
@@ -314,8 +314,8 @@ public function testRemoveCleansTraversableObjectOfFilesAndDirectories()
314
314
315
315
$ this ->filesystem ->remove ($ files );
316
316
317
- $ this ->assertTrue (! is_dir ( $ basePath .'dir ' ) );
318
- $ this ->assertTrue (! is_file ( $ basePath .'file ' ) );
317
+ $ this ->assertFileNotExists ( $ basePath .'dir ' );
318
+ $ this ->assertFileNotExists ( $ basePath .'file ' );
319
319
}
320
320
321
321
public function testRemoveIgnoresNonExistingFiles ()
@@ -330,7 +330,7 @@ public function testRemoveIgnoresNonExistingFiles()
330
330
331
331
$ this ->filesystem ->remove ($ files );
332
332
333
- $ this ->assertTrue (! is_dir ( $ basePath .'dir ' ) );
333
+ $ this ->assertFileNotExists ( $ basePath .'dir ' );
334
334
}
335
335
336
336
public function testRemoveCleansInvalidLinks ()
@@ -342,11 +342,19 @@ public function testRemoveCleansInvalidLinks()
342
342
mkdir ($ basePath );
343
343
mkdir ($ basePath .'dir ' );
344
344
// create symlink to nonexistent file
345
- @symlink ($ basePath .'file ' , $ basePath .'link ' );
345
+ @symlink ($ basePath .'file ' , $ basePath .'file-link ' );
346
+
347
+ // create symlink to dir using trailing forward slash
348
+ $ this ->filesystem ->symlink ($ basePath .'dir/ ' , $ basePath .'dir-link ' );
349
+ $ this ->assertTrue (is_dir ($ basePath .'dir-link ' ));
350
+
351
+ // create symlink to nonexistent dir
352
+ rmdir ($ basePath .'dir ' );
353
+ $ this ->assertFalse (is_dir ($ basePath .'dir-link ' ));
346
354
347
355
$ this ->filesystem ->remove ($ basePath );
348
356
349
- $ this ->assertTrue (! is_dir ( $ basePath) );
357
+ $ this ->assertFileNotExists ( $ basePath );
350
358
}
351
359
352
360
public function testFilesExists ()
@@ -1062,10 +1070,6 @@ private function getFileGroup($filepath)
1062
1070
*/
1063
1071
private function markAsSkippedIfSymlinkIsMissing ($ relative = false )
1064
1072
{
1065
- if (!function_exists ('symlink ' )) {
1066
- $ this ->markTestSkipped ('symlink is not supported ' );
1067
- }
1068
-
1069
1073
if (false === self ::$ symlinkOnWindows ) {
1070
1074
$ this ->markTestSkipped ('symlink requires "Create symbolic links" privilege on Windows ' );
1071
1075
}
0 commit comments