mirror of
https://github.com/php/php-src.git
synced 2025-01-11 05:24:49 +08:00
fix tests, use -n to prevent any problems with existing php.ini
This commit is contained in:
parent
f595859918
commit
f11c9c8871
@ -12,7 +12,7 @@ if (substr(PHP_OS, 0, 3) != 'WIN') {
|
||||
|
||||
$php = $_ENV['TEST_PHP_EXECUTABLE'];
|
||||
|
||||
var_dump(`"$php" -r "var_dump('hello');"`);
|
||||
var_dump(`"$php" -n -r "var_dump('hello');"`);
|
||||
|
||||
echo "Done\n";
|
||||
?>
|
||||
|
@ -12,7 +12,7 @@ if (substr(PHP_OS, 0, 3) == 'WIN') {
|
||||
|
||||
$php = $_ENV['TEST_PHP_EXECUTABLE'];
|
||||
|
||||
var_dump(`"$php" -r 'var_dump("hello");'`);
|
||||
var_dump(`"$php" -n -r 'var_dump("hello");'`);
|
||||
|
||||
echo "Done\n";
|
||||
?>
|
||||
|
@ -7,9 +7,9 @@ show information about function
|
||||
|
||||
$php = $_ENV['TEST_PHP_EXECUTABLE'];
|
||||
|
||||
var_dump(`"$php" --rf unknown`);
|
||||
var_dump(`"$php" --rf echo`);
|
||||
var_dump(`"$php" --rf phpinfo`);
|
||||
var_dump(`"$php" -n --rf unknown`);
|
||||
var_dump(`"$php" -n --rf echo`);
|
||||
var_dump(`"$php" -n --rf phpinfo`);
|
||||
|
||||
echo "Done\n";
|
||||
?>
|
||||
|
@ -7,9 +7,9 @@ show information about class
|
||||
|
||||
$php = $_ENV['TEST_PHP_EXECUTABLE'];
|
||||
|
||||
var_dump(`"$php" --rc unknown`);
|
||||
var_dump(`"$php" --rc stdclass`);
|
||||
var_dump(`"$php" --rc exception`);
|
||||
var_dump(`"$php" -n --rc unknown`);
|
||||
var_dump(`"$php" -n --rc stdclass`);
|
||||
var_dump(`"$php" -n --rc exception`);
|
||||
|
||||
echo "Done\n";
|
||||
?>
|
||||
|
@ -7,8 +7,8 @@ show information about extension
|
||||
|
||||
$php = $_ENV['TEST_PHP_EXECUTABLE'];
|
||||
|
||||
var_dump(`"$php" --re unknown`);
|
||||
var_dump(`"$php" --re ""`);
|
||||
var_dump(`"$php" -n --re unknown`);
|
||||
var_dump(`"$php" -n --re ""`);
|
||||
var_dump(`"$php" -n --re date`);
|
||||
|
||||
echo "Done\n";
|
||||
|
@ -32,9 +32,9 @@ class test { /* {{{ */
|
||||
|
||||
file_put_contents($filename, $code);
|
||||
|
||||
var_dump(`"$php" -w "$filename"`);
|
||||
var_dump(`"$php" -w "wrong"`);
|
||||
var_dump(`echo "<?php /* comment */ class test {\n // comment \n function foo() {} } ?>" | $php -w`);
|
||||
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`);
|
||||
|
||||
@unlink($filename);
|
||||
|
||||
|
@ -26,8 +26,8 @@ var_dump(test::$pri);
|
||||
|
||||
file_put_contents($filename, $code);
|
||||
|
||||
var_dump(`"$php" -f "$filename"`);
|
||||
var_dump(`"$php" -f "wrong"`);
|
||||
var_dump(`"$php" -n -f "$filename"`);
|
||||
var_dump(`"$php" -n -f "wrong"`);
|
||||
|
||||
@unlink($filename);
|
||||
|
||||
|
@ -8,8 +8,8 @@ using invalid combinations of cmdline options
|
||||
$php = $_ENV['TEST_PHP_EXECUTABLE'];
|
||||
|
||||
var_dump(`"$php" -n -c -r 'echo hello;'`);
|
||||
var_dump(`"$php" -a -r 'echo hello;'`);
|
||||
var_dump(`"$php" -r 'echo hello;' -a`);
|
||||
var_dump(`"$php" -n -a -r 'echo hello;'`);
|
||||
var_dump(`"$php" -n -r 'echo hello;' -a`);
|
||||
|
||||
echo "Done\n";
|
||||
?>
|
||||
|
@ -21,7 +21,7 @@ hello
|
||||
|
||||
file_put_contents($filename_txt, $txt);
|
||||
|
||||
var_dump(`cat "$filename_txt" | "$php" -R "var_dump(1);"`);
|
||||
var_dump(`cat "$filename_txt" | "$php" -n -R "var_dump(1);"`);
|
||||
|
||||
@unlink($filename_txt);
|
||||
|
||||
|
@ -30,7 +30,7 @@ hello
|
||||
|
||||
file_put_contents($filename_txt, $txt);
|
||||
|
||||
var_dump(`cat "$filename_txt" | "$php" -F "$filename"`);
|
||||
var_dump(`cat "$filename_txt" | "$php" -n -F "$filename"`);
|
||||
|
||||
@unlink($filename);
|
||||
@unlink($filename_txt);
|
||||
|
@ -25,8 +25,8 @@ echo test::$var;
|
||||
|
||||
file_put_contents($filename, $code);
|
||||
|
||||
var_dump(`"$php" -l "$filename"`);
|
||||
var_dump(`"$php" -l some.unknown`);
|
||||
var_dump(`"$php" -n -l "$filename"`);
|
||||
var_dump(`"$php" -n -l some.unknown`);
|
||||
|
||||
$code = '
|
||||
<?php
|
||||
@ -40,7 +40,7 @@ class test
|
||||
|
||||
file_put_contents($filename, $code);
|
||||
|
||||
var_dump(`"$php" -l "$filename"`);
|
||||
var_dump(`"$php" -n -l "$filename"`);
|
||||
|
||||
@unlink($filename);
|
||||
|
||||
|
@ -7,14 +7,14 @@ invalid arguments and error messages
|
||||
|
||||
$php = $_ENV['TEST_PHP_EXECUTABLE'];
|
||||
|
||||
var_dump(`"$php" -F some.php -F some.php`);
|
||||
var_dump(`"$php" -F some.php -R some.php`);
|
||||
var_dump(`"$php" -R some.php -F some.php`);
|
||||
var_dump(`"$php" -R some.php -R some.php`);
|
||||
var_dump(`"$php" -f some.php -f some.php`);
|
||||
var_dump(`"$php" -B '' -B ''`);
|
||||
var_dump(`"$php" -E '' -E ''`);
|
||||
var_dump(`"$php" -r "" -r ""`);
|
||||
var_dump(`"$php" -n -F some.php -F some.php`);
|
||||
var_dump(`"$php" -n -F some.php -R some.php`);
|
||||
var_dump(`"$php" -n -R some.php -F some.php`);
|
||||
var_dump(`"$php" -n -R some.php -R some.php`);
|
||||
var_dump(`"$php" -n -f some.php -f some.php`);
|
||||
var_dump(`"$php" -n -B '' -B ''`);
|
||||
var_dump(`"$php" -n -E '' -E ''`);
|
||||
var_dump(`"$php" -n -r "" -r ""`);
|
||||
|
||||
echo "Done\n";
|
||||
?>
|
||||
|
@ -15,9 +15,9 @@ $php = $_ENV['TEST_PHP_EXECUTABLE'];
|
||||
$filename_txt = dirname(__FILE__)."/013.test.txt";
|
||||
file_put_contents($filename_txt, "test\nfile\ncontents\n");
|
||||
|
||||
var_dump(`cat "$filename_txt" | "$php" -B 'var_dump("start");'`);
|
||||
var_dump(`cat "$filename_txt" | "$php" -E 'var_dump("end");'`);
|
||||
var_dump(`cat "$filename_txt" | "$php" -B 'var_dump("start");' -E 'var_dump("end");'`);
|
||||
var_dump(`cat "$filename_txt" | "$php" -n -B 'var_dump("start");'`);
|
||||
var_dump(`cat "$filename_txt" | "$php" -n -E 'var_dump("end");'`);
|
||||
var_dump(`cat "$filename_txt" | "$php" -n -B 'var_dump("start");' -E 'var_dump("end");'`);
|
||||
|
||||
@unlink($filename_txt);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user