]> granicus.if.org Git - php/commitdiff
- 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:06 +0000 (13:07 +0000)
committerPierre Joye <pajoye@php.net>
Sun, 17 Aug 2008 13:07:06 +0000 (13:07 +0000)
ext/standard/tests/general_functions/bug41518.phpt

index 07c34272233a65ee4817190d15e19c915b355562..097ba029174b796bbba595b276d38203695c629b 100644 (file)
@@ -3,13 +3,14 @@ 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
 
@@ -21,7 +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";
 ?>
 --EXPECT--