From: Nikita Popov Date: Fri, 12 Apr 2019 07:56:46 +0000 (+0200) Subject: Avoid directory clash in realpath tests X-Git-Tag: php-7.4.0alpha1~534 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0774d67ff958baa0ad08ae202c90a6553417d39a;p=php Avoid directory clash in realpath tests --- diff --git a/ext/standard/tests/file/realpath_basic3.phpt b/ext/standard/tests/file/realpath_basic3.phpt index 0feccfc150..622c1d6cce 100644 --- a/ext/standard/tests/file/realpath_basic3.phpt +++ b/ext/standard/tests/file/realpath_basic3.phpt @@ -10,11 +10,11 @@ echo "\n*** Testing basic functions of realpath() with files ***\n"; /* creating directories and files */ $file_path = __DIR__; -mkdir("$file_path/realpath_basic/home/test/", 0777, true); +mkdir("$file_path/realpath_basic3/home/test/", 0777, true); -$file_handle1 = fopen("$file_path/realpath_basic/home/test/realpath_basic.tmp", "w"); -$file_handle2 = fopen("$file_path/realpath_basic/home/realpath_basic.tmp", "w"); -$file_handle3 = fopen("$file_path/realpath_basic/realpath_basic.tmp", "w"); +$file_handle1 = fopen("$file_path/realpath_basic3/home/test/realpath_basic3.tmp", "w"); +$file_handle2 = fopen("$file_path/realpath_basic3/home/realpath_basic3.tmp", "w"); +$file_handle3 = fopen("$file_path/realpath_basic3/realpath_basic3.tmp", "w"); fclose($file_handle1); fclose($file_handle2); fclose($file_handle3); @@ -22,17 +22,17 @@ fclose($file_handle3); echo "\n*** Testing realpath() on filenames ***\n"; $filenames = array ( /* filenames resulting in valid paths */ - "./realpath_basic/home/realpath_basic.tmp", - "./realpath_basic/realpath_basic.tmp", - "./realpath_basic//home/test//../test/./realpath_basic.tmp", - "./realpath_basic/home//../././realpath_basic.tmp", + "./realpath_basic3/home/realpath_basic3.tmp", + "./realpath_basic3/realpath_basic3.tmp", + "./realpath_basic3//home/test//../test/./realpath_basic3.tmp", + "./realpath_basic3/home//../././realpath_basic3.tmp", /* filenames with invalid path */ // checking for binary safe - "./realpath_basicx000/home/realpath_basic.tmp", + "./realpath_basic3x000/home/realpath_basic3.tmp", - ".///realpath_basic/home//..//././test//realpath_basic.tmp", - "./realpath_basic/home/../home/../test/..realpath_basic.tmp" + ".///realpath_basic3/home//..//././test//realpath_basic3.tmp", + "./realpath_basic3/home/../home/../test/..realpath_basic3.tmp" ); chdir("$file_path/.."); @@ -50,10 +50,10 @@ echo "Done\n"; ?> --CLEAN-- --CLEAN-- --EXPECTF-- -1. %s%erealpath_basic%ehome -2. %s%erealpath_basic%ehome%etest +1. %s%erealpath_basic4%ehome +2. %s%erealpath_basic4%ehome%etest