File tree Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -94,7 +94,9 @@ public function remove($files)
9494
9595 if (is_dir ($ file ) && !is_link ($ file )) {
9696 $ this ->remove (new \FilesystemIterator ($ file ));
97-
97+ rmdir ($ file );
98+ } elseif (is_dir ($ file ) && is_link ($ file )) {
99+ // https://bugs.php.net/bug.php?id=52176 windows thinks symlinks are directories
98100 rmdir ($ file );
99101 } else {
100102 unlink ($ file );
Original file line number Diff line number Diff line change @@ -421,6 +421,20 @@ public function testSymlink()
421421 $ this ->assertTrue (is_link ($ link ));
422422 $ this ->assertEquals ($ file , readlink ($ link ));
423423 }
424+
425+ /**
426+ * @depends testSymlink
427+ */
428+ public function testRemoveSymlink ()
429+ {
430+ $ this ->markAsSkippedIfSymlinkIsMissing ();
431+
432+ $ link = $ this ->workspace .DIRECTORY_SEPARATOR .'link ' ;
433+
434+ $ this ->filesystem ->remove ($ link );
435+
436+ $ this ->assertTrue (!is_link ($ link ));
437+ }
424438
425439 public function testSymlinkIsOverwrittenIfPointsToDifferentTarget ()
426440 {
You can’t perform that action at this time.
0 commit comments