Skip to content

Commit 5c671c3

Browse files
committed
Merge branch 'PHP-8.3'
* PHP-8.3: Fix rename test file name collision
2 parents 8475cfb + df4d59e commit 5c671c3

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

ext/standard/tests/file/rename_variation2-win32.phpt

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,28 +11,28 @@ if (substr(PHP_OS, 0, 3) != 'WIN') {
1111
require __DIR__.'/file.inc';
1212

1313
$file_path = __DIR__;
14-
mkdir("$file_path/rename_variation2_dir");
14+
mkdir("$file_path/rename_variation2-win32_dir");
1515

1616
/* Renaming a file and directory to numeric name */
1717
echo "\n*** Testing rename() by renaming a file and directory to numeric name ***\n";
18-
$fp = fopen($file_path."/rename_variation2.tmp", "w");
18+
$fp = fopen($file_path."/rename_variation2-win32.tmp", "w");
1919
fclose($fp);
2020

2121
// renaming existing file to numeric name
22-
var_dump( rename($file_path."/rename_variation2.tmp", $file_path."/12345") );
22+
var_dump( rename($file_path."/rename_variation2-win32.tmp", $file_path."/12346") );
2323

2424
// ensure that rename worked fine
25-
var_dump( file_exists($file_path."/rename_variation2.tmp" ) ); // expecting false
26-
var_dump( file_exists($file_path."/12345" ) ); // expecting true
25+
var_dump( file_exists($file_path."/rename_variation2-win32.tmp" ) ); // expecting false
26+
var_dump( file_exists($file_path."/12346" ) ); // expecting true
2727

28-
unlink($file_path."/12345");
28+
unlink($file_path."/12346");
2929

3030
// renaming a directory to numeric name
31-
var_dump( rename($file_path."/rename_variation2_dir/", $file_path."/12345") );
31+
var_dump( rename($file_path."/rename_variation2-win32_dir/", $file_path."/12346") );
3232

3333
// ensure that rename worked fine
34-
var_dump( file_exists($file_path."/rename_variation2_dir" ) ); // expecting false
35-
var_dump( file_exists($file_path."/12345" ) ); // expecting true
34+
var_dump( file_exists($file_path."/rename_variation2-win32_dir" ) ); // expecting false
35+
var_dump( file_exists($file_path."/12346" ) ); // expecting true
3636

3737
echo "Done\n";
3838
?>

0 commit comments

Comments
 (0)