[php-src] PHP-8.2: Fix rename test file name collision
| From: | Ilija Tovilo | Date: | Mon, 15 Apr 2024 11:43:51 +0000 |
| Subject: | [php-src] PHP-8.2: Fix rename test file name collision | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-128108@lists.php.net to get a copy of this message | ||
Author: Ilija Tovilo (iluuu1994)
Date: 2024-04-15T13:42:40+02:00
Commit: https://github.com/php/php-src/commit/f2cd0d5752c94423a1c212ecd767ee01b391183e
Raw diff: https://github.com/php/php-src/commit/f2cd0d5752c94423a1c212ecd767ee01b391183e.diff
Fix rename test file name collision
Changed paths:
M ext/standard/tests/file/rename_variation2-win32.phpt
Diff:
diff --git a/ext/standard/tests/file/rename_variation2-win32.phpt
b/ext/standard/tests/file/rename_variation2-win32.phpt
index b486fcc543d6..e1ce5c22afbd 100644
--- a/ext/standard/tests/file/rename_variation2-win32.phpt
+++ b/ext/standard/tests/file/rename_variation2-win32.phpt
@@ -11,28 +11,28 @@ if (substr(PHP_OS, 0, 3) != 'WIN') {
require __DIR__.'/file.inc';
$file_path = __DIR__;
-mkdir("$file_path/rename_variation2_dir");
+mkdir("$file_path/rename_variation2-win32_dir");
/* Renaming a file and directory to numeric name */
echo "\n*** Testing rename() by renaming a file and directory to numeric name ***\n";
-$fp = fopen($file_path."/rename_variation2.tmp", "w");
+$fp = fopen($file_path."/rename_variation2-win32.tmp", "w");
fclose($fp);
// renaming existing file to numeric name
-var_dump( rename($file_path."/rename_variation2.tmp", $file_path."/12345") );
+var_dump( rename($file_path."/rename_variation2-win32.tmp",
$file_path."/12346") );
// ensure that rename worked fine
-var_dump( file_exists($file_path."/rename_variation2.tmp" ) ); // expecting false
-var_dump( file_exists($file_path."/12345" ) ); // expecting true
+var_dump( file_exists($file_path."/rename_variation2-win32.tmp" ) ); // expecting false
+var_dump( file_exists($file_path."/12346" ) ); // expecting true
-unlink($file_path."/12345");
+unlink($file_path."/12346");
// renaming a directory to numeric name
-var_dump( rename($file_path."/rename_variation2_dir/", $file_path."/12345") );
+var_dump( rename($file_path."/rename_variation2-win32_dir/",
$file_path."/12346") );
// ensure that rename worked fine
-var_dump( file_exists($file_path."/rename_variation2_dir" ) ); // expecting false
-var_dump( file_exists($file_path."/12345" ) ); // expecting true
+var_dump( file_exists($file_path."/rename_variation2-win32_dir" ) ); // expecting false
+var_dump( file_exists($file_path."/12346" ) ); // expecting true
echo "Done\n";
?>