]> granicus.if.org Git - php/commitdiff
Do not make the test rely on the availability of the cat command.
authorIlia Alshanetsky <iliaa@php.net>
Sat, 19 Apr 2003 17:45:46 +0000 (17:45 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Sat, 19 Apr 2003 17:45:46 +0000 (17:45 +0000)
ext/standard/tests/file/bug22414.phpt

index 821eb4ecfede5bbd9ae222380c5bbc9ff39c8877..6902b643b15de84e129a14d1a1361d805819db97 100644 (file)
@@ -5,10 +5,6 @@ Bug #22414: passthru() does not read data correctly
        if (ini_get("safe_mode")) {
                die('skip this test cannot be run under safe-mode');
        }
-       $cat_path = @shell_exec("which cat");
-       if (empty($cat_path)) {
-               die('skip cat binary needed for this test is not avaliable');
-       }
 ?>
 --POST--
 --GET--
@@ -25,7 +21,8 @@ Bug #22414: passthru() does not read data correctly
        /* Binary Data Test */
        @unlink($pwd . '/passthru_test');
        
-       $cmd = $php . ' -r \' passthru("cat ' . $php . '"); \' > ' . $pwd . '/passthru_test';
+       $cmd = "sapi/cli/php -r \\\" readfile(@getenv(TEST_PHP_EXECUTABLE)); \\\"";
+       $cmd = $php . ' -r \' passthru("'.$cmd.'"); \' > ' . $pwd . '/passthru_test';
        exec($cmd);
        
        if (md5_file($php) == md5_file($pwd . '/passthru_test')) {