Skip to content

Commit a046252

Browse files
Merge branch '4.1'
* 4.1: [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 Ensure updateTimestamp returns a boolean Fix #27378: Error when rendering a DateIntervalType form with exactly 0 weeks [HttpKernel] fix session tracking in surrogate master requests
2 parents 90b37e7 + 8468bf2 commit a046252

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
@@ -69,11 +69,20 @@ public static function setUpBeforeClass()
6969

7070
public static function tearDownAfterClass()
7171
{
72-
foreach (array_reverse(self::$files) as $file) {
73-
if (DIRECTORY_SEPARATOR === $file[strlen($file) - 1]) {
74-
@rmdir($file);
72+
$paths = new \RecursiveIteratorIterator(
73+
new \RecursiveDirectoryIterator(self::$tmpDir, \RecursiveDirectoryIterator::SKIP_DOTS),
74+
\RecursiveIteratorIterator::CHILD_FIRST
75+
);
76+
77+
foreach ($paths as $path) {
78+
if ($path->isDir()) {
79+
if ($path->isLink()) {
80+
@unlink($path);
81+
} else {
82+
@rmdir($path);
83+
}
7584
} else {
76-
@unlink($file);
85+
@unlink($path);
7786
}
7887
}
7988
}

0 commit comments

Comments
 (0)