com php-src: Properly clean up test case: ext/standard/tests/fi le/windows_mb_path/test_long_path_mkdir.phpt
| From: | Christoph Michael Becker | Date: | Fri, 22 Feb 2019 08:43:12 +0000 |
| Subject: | com php-src: Properly clean up test case: ext/standard/tests/fi le/windows_mb_path/test_long_path_mkdir.phpt | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-104821@lists.php.net to get a copy of this message | ||
Commit: f319419d51873c3134e7e8c5681edf23a8d9c4dd
Author: Christoph M. Becker <cmbecker69@gmx.de> Fri, 22 Feb 2019 09:43:12 +0100
Parents: 22691f9ef7491de61d31783cffaf6d325c48b63e
Branches: PHP-7.4 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=f319419d51873c3134e7e8c5681edf23a8d9c4dd
Log:
Properly clean up test case
If we had to create an initial $start directory, we should remove it
at the end of the test.
Changed paths:
M ext/standard/tests/file/windows_mb_path/test_long_path_mkdir.phpt
Diff:
diff --git a/ext/standard/tests/file/windows_mb_path/test_long_path_mkdir.phpt
b/ext/standard/tests/file/windows_mb_path/test_long_path_mkdir.phpt
index 5cc697c..9dc7cf3 100644
--- a/ext/standard/tests/file/windows_mb_path/test_long_path_mkdir.phpt
+++ b/ext/standard/tests/file/windows_mb_path/test_long_path_mkdir.phpt
@@ -24,9 +24,11 @@ for ($i = 0; $i < $how_many; $i++) {
}
$start = realpath(dirname(__FILE__));
+$newstart = false;
if (strlen($start) <= 248) {
// create the exact length
$start = $start . "\\" . str_repeat('a', 251 - strlen($start) - 1);
+ $newstart = true;
}
var_dump($start);
@@ -47,6 +49,9 @@ for ($i = 0; $i < $how_many; $i++) {
$p0 = substr($p, 0, strlen($p) - $i*51);
rmdir($p0);
}
+if ($newstart) {
+ rmdir($start);
+}
?>
===DONE===