]> granicus.if.org Git - php/commitdiff
- MFH: fix test (portable), use . as basedir and create the tmp dir in the test directory
authorPierre Joye <pajoye@php.net>
Sun, 17 Aug 2008 13:07:39 +0000 (13:07 +0000)
committerPierre Joye <pajoye@php.net>
Sun, 17 Aug 2008 13:07:39 +0000 (13:07 +0000)
ext/standard/tests/general_functions/bug41518.phpt

index 675b82ccacadd011f6faeb3242229f724b2f820f..ca9188bf64d843cbbec7d2a7a3d83d6733f875f2 100644 (file)
@@ -3,17 +3,18 @@ Bug #41518 (file_exists() warns of open_basedir restriction on non-existent file
 --SKIPIF--
 <?php
 /* let's use /tmp here */
-$tmp_dir = "/tmp";
-if (!is_dir($tmp_dir) || realpath($tmp_dir) !== $tmp_dir) {
+$tmp_dir = __DIR__ . '/tmp';
+mkdir($tmp_dir);
+if (!is_dir($tmp_dir)) {
        die("skip");
 }
 ?>
 --INI--
-open_basedir=/tmp/
+open_basedir=.
 --FILE--
 <?php
 
-$tmp_dir = "/tmp";
+$tmp_dir =  __DIR__ . '/tmp';
 $tmp_file = $tmp_dir."/bug41418.tmp";
 
 touch($tmp_file);
@@ -21,6 +22,7 @@ var_dump(file_exists($tmp_file)); //exists
 var_dump(file_exists($tmp_file."nosuchfile")); //doesn't exist
 
 @unlink($tmp_file);
+@rmdir($tmp_dir);
 
 echo "Done\n";
 ?>