File tree Expand file tree Collapse file tree 2 files changed +17
-1
lines changed
src/Symfony/Component/Filesystem 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)
94
94
95
95
if (is_dir ($ file ) && !is_link ($ file )) {
96
96
$ 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
98
100
rmdir ($ file );
99
101
} else {
100
102
unlink ($ file );
Original file line number Diff line number Diff line change @@ -421,6 +421,20 @@ public function testSymlink()
421
421
$ this ->assertTrue (is_link ($ link ));
422
422
$ this ->assertEquals ($ file , readlink ($ link ));
423
423
}
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
+ }
424
438
425
439
public function testSymlinkIsOverwrittenIfPointsToDifferentTarget ()
426
440
{
You can’t perform that action at this time.
0 commit comments