mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
Fix file test race condition
005_variation2.phpt creates files with special names, and filesize_variation5.phpt checks for filesize of inexistent files with special names. Create the files in a separate directory to avoid these tests clashing. Closes GH-12692
This commit is contained in:
@@ -28,6 +28,11 @@ function stat_fn( $filename ) {
|
||||
|
||||
echo "*** Testing fileattime(), filemtime(), filectime() & touch() : usage variations ***\n";
|
||||
echo "\n*** testing touch ***\n";
|
||||
|
||||
$dir = __DIR__ . '/005_variation2';
|
||||
mkdir($dir);
|
||||
chdir($dir);
|
||||
|
||||
$b = touch(false);
|
||||
$c = touch('');
|
||||
$d = touch(' ');
|
||||
@@ -47,6 +52,7 @@ stat_fn('|');
|
||||
|
||||
var_dump(unlink(' '));
|
||||
var_dump(unlink('|'));
|
||||
rmdir($dir);
|
||||
|
||||
echo "Done";
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user