php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login

Patch php-cgi-tests.patch for CGI/CLI related Bug #61950

Patch version 2012-05-05 07:42 UTC

Return to Bug #61950 | Download this patch
Patch Revisions:

Developer: remi

diff -up tests/001.phpt.orig tests/001.phpt
--- tests/001.phpt.orig	2012-05-05 08:41:43.229085079 +0200
+++ tests/001.phpt	2012-05-05 08:59:28.422110570 +0200
@@ -10,13 +10,12 @@ include "include.inc";
 $php = get_cgi_path();
 reset_env_vars();
 
-var_dump(`$php -n -v`);
+passthru("$php -n -v");
 
 echo "Done\n";
 ?>
 --EXPECTF--
-string(%d) "PHP %s (cgi%s (built: %s
+PHP %s (cgi%s (built: %s
 Copyright (c) 1997-20%s The PHP Group
 Zend Engine v%s, Copyright (c) 1998-20%s Zend Technologies
-"
 Done
diff -up tests/002.phpt.orig tests/002.phpt
--- tests/002.phpt.orig	2012-05-05 08:41:43.232085076 +0200
+++ tests/002.phpt	2012-05-05 09:05:44.962119582 +0200
@@ -15,38 +15,34 @@ $file = dirname(__FILE__)."/002.test.php
 
 file_put_contents($file, '<?php var_dump(ini_get("max_execution_time")); ?>');
 
-var_dump(`$php -n -d max_execution_time=111 $file`);
-var_dump(`$php -n -d max_execution_time=500 $file`);
-var_dump(`$php -n -d max_execution_time=500 -d max_execution_time=555 $file`);
+passthru("$php -n -d max_execution_time=111 $file");
+passthru("$php -n -d max_execution_time=500 $file");
+passthru("$php -n -d max_execution_time=500 -d max_execution_time=555 $file");
 
 file_put_contents($file, '<?php var_dump(ini_get("max_execution_time")); var_dump(ini_get("upload_tmp_dir")); ?>');
 
-var_dump(`$php -n -d upload_tmp_dir=/test/path -d max_execution_time=555 $file`);
+passthru("$php -n -d upload_tmp_dir=/test/path -d max_execution_time=555 $file");
 
 unlink($file);
 
 echo "Done\n";
 ?>
 --EXPECTF--	
-string(%d) "X-Powered-By: PHP/%s
-Content-type: text/html%r; charset=.*|%r
+X-Powered-By: PHP/%s
+Content-type: text/%s
 
-%unicode|string%(3) "111"
-"
-string(%d) "X-Powered-By: PHP/%s
-Content-type: text/html%r; charset=.*|%r
-
-%unicode|string%(3) "500"
-"
-string(%d) "X-Powered-By: PHP/%s
-Content-type: text/html%r; charset=.*|%r
-
-%unicode|string%(3) "555"
-"
-string(%d) "X-Powered-By: PHP/%s
-Content-type: text/html%r; charset=.*|%r
-
-%unicode|string%(3) "555"
-%unicode|string%(10) "/test/path"
-"
+string(3) "111"
+X-Powered-By: PHP/%s
+Content-type: text/%s
+
+string(3) "500"
+X-Powered-By: PHP/%s
+Content-type: text/%s
+
+string(3) "555"
+X-Powered-By: PHP/%s
+Content-type: text/%s
+
+string(3) "555"
+string(10) "/test/path"
 Done
diff -up tests/003.phpt.orig tests/003.phpt
--- tests/003.phpt.orig	2012-05-05 08:41:43.234085079 +0200
+++ tests/003.phpt	2012-05-05 09:16:06.959134467 +0200
@@ -32,31 +32,28 @@ class test { /* {{{ */
 
 file_put_contents($filename, $code);
 
-var_dump(`$php -n -w "$filename"`);
-var_dump(`$php -n -w "wrong"`);
-var_dump(`echo "<?php /* comment */ class test {\n // comment \n function foo() {} } ?>" | $php -n -w`);
+passthru("$php -n -w \"$filename\"");
+passthru("$php -n -w \"wrong\"");
+passthru("echo \"<?php /* comment */ class test {\n // comment \n function foo() {} } ?>\" | $php -n -w");
 
 @unlink($filename);
 
 echo "Done\n";
 ?>
 --EXPECTF--	
-string(%d) "X-Powered-By: PHP/%s
-Content-type: text/html%r; charset=.*|%r
+X-Powered-By: PHP/%s
+Content-type: text/%s
 
 
 <?php
  class test { public $var = "test"; private $pri; function foo() { } } ?>
-"
-string(%d) "Status: 404 Not Found
+Status: 404 Not Found
 X-Powered-By: PHP/%s
-Content-type: text/html%r; charset=.*|%r
+Content-type: text/%s
 
 No input file specified.
-"
-string(%d) "X-Powered-By: PHP/%s
-Content-type: text/html%r; charset=.*|%r
+X-Powered-By: PHP/%s
+Content-type: text/%s
 
 <?php  class test { function foo() {} } ?>
-"
 Done
diff -up tests/004.phpt.orig tests/004.phpt
--- tests/004.phpt.orig	2012-05-05 08:41:43.236085078 +0200
+++ tests/004.phpt	2012-05-05 09:17:07.548135918 +0200
@@ -26,18 +26,15 @@ var_dump(test::$pri);
 
 file_put_contents($filename, $code);
 
-var_dump(`$php -n -f "$filename" 2>/dev/null`);
-var_dump(`$php -n -f "wrong"`);
+passthru("$php -n -f \"$filename\" 2>/dev/null");
+passthru("$php -n -f \"wrong\"");
 
 @unlink($filename);
 
 echo "Done\n";
 ?>
 --EXPECTF--	
-string(%d) "
 <br />
 <b>Fatal error</b>:  Cannot access private property test::$pri in <b>%s004.test.php</b> on line <b>8</b><br />
-"
-string(25) "No input file specified.
-"
+No input file specified.
 Done
diff -up tests/005.phpt.orig tests/005.phpt
--- tests/005.phpt.orig	2012-05-05 08:41:43.238085076 +0200
+++ tests/005.phpt	2012-05-05 09:17:45.370136824 +0200
@@ -10,18 +10,16 @@ include "include.inc";
 $php = get_cgi_path();
 reset_env_vars();
 
-var_dump(`$php -n -a -f 'wrong'`);
-var_dump(`$php -n -f 'wrong' -a`);
+passthru("$php -n -a -f 'wrong'");
+passthru("$php -n -f 'wrong' -a");
 
 echo "Done\n";
 ?>
 --EXPECTF--	
-string(51) "No input file specified.
+No input file specified.
 Interactive mode enabled
 
-"
-string(51) "No input file specified.
+No input file specified.
 Interactive mode enabled
 
-"
 Done
diff -up tests/006.phpt.orig tests/006.phpt
--- tests/006.phpt.orig	2012-05-05 08:41:43.240085075 +0200
+++ tests/006.phpt	2012-05-05 09:19:24.340139192 +0200
@@ -29,8 +29,8 @@ echo test::$var;
 
 file_put_contents($filename, $code);
 
-var_dump(`"$php" -n -l "$filename"`);
-var_dump(`"$php" -n -l some.unknown`);
+passthru("$php -n -l \"$filename\"");
+passthru("$php -n -l some.unknown");
 
 $code = '
 <?php
@@ -44,19 +44,16 @@ class test
 
 file_put_contents($filename, $code);
 
-var_dump(`"$php" -n -l "$filename" 2>/dev/null`);
+passthru("$php -n -l \"$filename\" 2>/dev/null");
 
 @unlink($filename);
 
 echo "Done\n";
 ?>
 --EXPECTF--	
-string(%d) "No syntax errors detected in %s006.test.php
-"
-string(%d) "No input file specified.
-"
-string(%d) "<br />
+No syntax errors detected in %s006.test.php
+No input file specified.
+<br />
 <b>Parse error</b>: %s expecting %s{%s in <b>%s006.test.php</b> on line <b>5</b><br />
 Errors parsing %s006.test.php
-"
 Done
diff -up tests/007.phpt.orig tests/007.phpt
--- tests/007.phpt.orig	2012-05-05 08:41:43.242085077 +0200
+++ tests/007.phpt	2012-05-05 09:20:07.752140232 +0200
@@ -9,14 +9,12 @@ include "include.inc";
 $php = get_cgi_path();
 reset_env_vars();
 
-var_dump(`"$php" -n -f some.php -f some.php`);
-var_dump(`"$php" -n -s -w -l`);
+passthru("$php -n -f some.php -f some.php");
+passthru("$php -n -s -w -l");
 
 ?>
 ===DONE===
 --EXPECTF--	
-string(25) "No input file specified.
-"
-string(31) "No syntax errors detected in -
-"
+No input file specified.
+No syntax errors detected in -
 ===DONE===
diff -up tests/008.phpt.orig tests/008.phpt
--- tests/008.phpt.orig	2012-05-05 08:41:43.244085078 +0200
+++ tests/008.phpt	2012-05-05 09:21:43.590142525 +0200
@@ -30,25 +30,23 @@ $o = new test;
 
 file_put_contents($filename, $code);
 
-var_dump(`"$php" -n -s "$filename"`);
-var_dump(`"$php" -n -s "unknown"`);
+passthru("\"$php\" -n -s \"$filename\"");
+passthru("\"$php\" -n -s \"unknown\"");
 
 @unlink($filename);
 
 echo "Done\n";
 ?>
 --EXPECTF--	
-string(%d) "X-Powered-By: PHP/%s
-Content-type: text/html%r; charset=.*|%r
+X-Powered-By: PHP/%s
+Content-type: text/%s
 
 <code><span style="color: #000000">
 <br /><span style="color: #0000BB">&lt;?php<br />$test&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">"var"</span><span style="color: #007700">;&nbsp;</span><span style="color: #FF8000">//var<br />/*&nbsp;test&nbsp;class&nbsp;*/<br /></span><span style="color: #007700">class&nbsp;</span><span style="color: #0000BB">test&nbsp;</span><span style="color: #007700">{<br />&nbsp;&nbsp;&nbsp;&nbsp;private&nbsp;</span><span style="color: #0000BB">$var&nbsp;</span><span style="color: #007700">=&nbsp;array();<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;public&nbsp;static&nbsp;function&nbsp;</span><span style="color: #0000BB">foo</span><span style="color: #007700">(</span><span style="color: #0000BB">Test&nbsp;$arg</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #DD0000">"hello"</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">$this</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;}<br />}<br /><br /></span><span style="color: #0000BB">$o&nbsp;</span><span style="color: #007700">=&nbsp;new&nbsp;</span><span style="color: #0000BB">test</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">?&gt;<br /></span>
 </span>
-</code>"
-string(%d) "Status: 404 Not Found
+</code>Status: 404 Not Found
 X-Powered-By: PHP/%s
-Content-type: text/html%r; charset=.*|%r
+Content-type: text/%s
 
 No input file specified.
-"
 Done
diff -up tests/009.phpt.orig tests/009.phpt
--- tests/009.phpt.orig	2012-05-05 08:41:43.246085078 +0200
+++ tests/009.phpt	2012-05-05 09:22:09.396143142 +0200
@@ -24,7 +24,7 @@ echo "Done\n";
 ?>
 --EXPECTF--
 X-Powered-By: PHP/%s
-Content-type: text/html%r; charset=.*|%r
+Content-type: text/%s
 
 string(%d) "%s/x"
 Done
diff -up tests/010.phpt.orig tests/010.phpt
diff -up tests/011.phpt.orig tests/011.phpt
diff -up tests/skipif.inc.orig tests/skipif.inc
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Sep 28 15:01:28 2024 UTC