Skip to content

Commit 8468bf2

Browse files
Merge branch '4.0' into 4.1
* 4.0: [HttpKernel] fix PHP 5.4 compat Fix surrogate not using original request [Finder] Update RealIteratorTestCase [Routing] remove unneeded dev dep on doctrine/common [minor] SCA [Validator] Remove BOM in some xlf files Fix #27378: Error when rendering a DateIntervalType form with exactly 0 weeks [HttpKernel] fix session tracking in surrogate master requests
2 parents 4c4cc02 + dfe0b9b commit 8468bf2

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)