]> granicus.if.org Git - php/commitdiff
Fix file clash in rename_variation.phpt
authorNikita Popov <nikita.ppv@gmail.com>
Fri, 27 Sep 2019 09:10:42 +0000 (11:10 +0200)
committerNikita Popov <nikita.ppv@gmail.com>
Fri, 27 Sep 2019 09:11:23 +0000 (11:11 +0200)
rename_variation2.tmp is ... unsurprisingly ... already used by
rename_variation2.phpt. Alternatively it could be placed in the
directory that the test creates, but maybe this is intended to
test cross-directory renames, so I'll leave it.

ext/standard/tests/file/rename_variation.phpt

index c347a223fc23ea8c100bc001ce2fdaaaead9c635..b86c5c80973d592073533f8cc20ccc2fd27626b3 100644 (file)
@@ -26,12 +26,12 @@ $src_filenames = array(
   "$file_path//rename_variation//rename_variation.tmp",
 );
 $counter = 1;
-/* loop through each $file and rename it to rename_variation2.tmp */
+/* loop through each $file and rename it to rename_variation_renamed.tmp */
 foreach($src_filenames as $src_filename) {
   echo "-- Iteration $counter --\n";
   $fp = fopen("$file_path/rename_variation/rename_variation.tmp", "w");
   fclose($fp);
-  $dest_filename = "$file_path/rename_variation2.tmp";
+  $dest_filename = "$file_path/rename_variation_renamed.tmp";
   var_dump( rename($src_filename, $dest_filename) );
   // ensure that file got renamed to new name
   var_dump( file_exists($src_filename) );  // expecting false