]> granicus.if.org Git - php/commitdiff
Fixed the test so it won't fail under safe mode
authorMoriyoshi Koizumi <moriyoshi@php.net>
Sat, 17 May 2003 20:00:46 +0000 (20:00 +0000)
committerMoriyoshi Koizumi <moriyoshi@php.net>
Sat, 17 May 2003 20:00:46 +0000 (20:00 +0000)
ext/standard/tests/file/bug22414.phpt

index 929c648e5d58c1351c3b4df5a5520b5373b502c5..b27e8057372e61518368426b4539b3bfe66a34f6 100644 (file)
@@ -7,11 +7,11 @@ Bug #22414: passthru() does not read data correctly
        }
 ?>
 --INI--
-output_handler=
+output_handler=a
 --FILE--
 <?php
-       $php = getenv('TEST_PHP_EXECUTABLE');
-       $pwd = realpath(dirname(__FILE__));
+$php = getenv('TEST_PHP_EXECUTABLE');
+$tmpfile = tempnam('/tmp', 'phpt');
        
        /* Regular Data Test */
        passthru($php . ' -r " echo \"HELLO\"; "');
@@ -22,16 +22,16 @@ output_handler=
        @unlink($pwd . '/passthru_test');
        
        $cmd = $php . " -r \\\" readfile(@getenv(TEST_PHP_EXECUTABLE)); \\\"";
-       $cmd = $php . ' -r \' passthru("'.$cmd.'"); \' > ' . $pwd . '/passthru_test';
+       $cmd = $php . ' -r \' passthru("'.$cmd.'"); \' > '.$tmpfile ;
        exec($cmd);
        
-       if (md5_file($php) == md5_file($pwd . '/passthru_test')) {
+       if (md5_file($php) == md5_file($tmpfile)) {
                echo "Works\n";
        } else {
                echo "Does not work\n";
        }
        
-       @unlink($pwd . '/passthru_test');
+       @unlink($tmpfile);
 ?>
 --EXPECT--
 HELLO