Skip to content

Commit a54351e

Browse files
Merge branch '2.8' into 3.4
* 2.8: [HttpKernel] fix PHP 5.4 compat Fix surrogate not using original request [Finder] Update RealIteratorTestCase [Routing] remove unneeded dev dep on doctrine/common [Validator] Remove BOM in some xlf files
2 parents 8efdfce + 237c871 commit a54351e

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

Tests/Iterator/RealIteratorTestCase.php

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,20 @@ public static function setUpBeforeClass()
6060

6161
public static function tearDownAfterClass()
6262
{
63-
foreach (array_reverse(self::$files) as $file) {
64-
if (DIRECTORY_SEPARATOR === $file[strlen($file) - 1]) {
65-
@rmdir($file);
63+
$paths = new \RecursiveIteratorIterator(
64+
new \RecursiveDirectoryIterator(self::$tmpDir, \RecursiveDirectoryIterator::SKIP_DOTS),
65+
\RecursiveIteratorIterator::CHILD_FIRST
66+
);
67+
68+
foreach ($paths as $path) {
69+
if ($path->isDir()) {
70+
if ($path->isLink()) {
71+
@unlink($path);
72+
} else {
73+
@rmdir($path);
74+
}
6675
} else {
67-
@unlink($file);
76+
@unlink($path);
6877
}
6978
}
7079
}

0 commit comments

Comments
 (0)