Skip to content

Commit f319419

Browse files
committed
Properly clean up test case
If we had to create an initial $start directory, we should remove it at the end of the test.
1 parent 22691f9 commit f319419

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

ext/standard/tests/file/windows_mb_path/test_long_path_mkdir.phpt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,11 @@ for ($i = 0; $i < $how_many; $i++) {
2424
}
2525

2626
$start = realpath(dirname(__FILE__));
27+
$newstart = false;
2728
if (strlen($start) <= 248) {
2829
// create the exact length
2930
$start = $start . "\\" . str_repeat('a', 251 - strlen($start) - 1);
31+
$newstart = true;
3032
}
3133

3234
var_dump($start);
@@ -47,6 +49,9 @@ for ($i = 0; $i < $how_many; $i++) {
4749
$p0 = substr($p, 0, strlen($p) - $i*51);
4850
rmdir($p0);
4951
}
52+
if ($newstart) {
53+
rmdir($start);
54+
}
5055

5156
?>
5257
===DONE===

0 commit comments

Comments
 (0)