mirror of
https://github.com/php/php-src.git
synced 2025-01-22 11:44:09 +08:00
fix tests
This commit is contained in:
parent
ec8318b438
commit
13dff74889
@ -10,15 +10,12 @@ include "include.inc";
|
||||
$php = get_cgi_path();
|
||||
reset_env_vars();
|
||||
|
||||
var_dump(`$php -n -c -f 'wrong'`);
|
||||
var_dump(`$php -n -a -f 'wrong'`);
|
||||
var_dump(`$php -n -f 'wrong' -a`);
|
||||
|
||||
echo "Done\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
string(55) "You cannot use both -n and -c switch. Use -h for help.
|
||||
"
|
||||
string(51) "No input file specified.
|
||||
Interactive mode enabled
|
||||
|
||||
|
@ -42,7 +42,7 @@ class test
|
||||
|
||||
file_put_contents($filename, $code);
|
||||
|
||||
var_dump(`"$php" -n -l "$filename" 2>/dev/null`);
|
||||
var_dump(`"$php" -l "$filename" 2>/dev/null`);
|
||||
|
||||
@unlink($filename);
|
||||
|
||||
|
@ -10,7 +10,7 @@ $php = get_cgi_path();
|
||||
reset_env_vars();
|
||||
|
||||
var_dump(`"$php" -n -f some.php -f some.php`);
|
||||
var_dump(`"$php" -s -w -l`);
|
||||
var_dump(`"$php" -n -s -w -l`);
|
||||
|
||||
?>
|
||||
===DONE===
|
||||
|
@ -8,7 +8,7 @@ function get_cgi_path() /* {{{ */
|
||||
$cgi = false;
|
||||
|
||||
if (file_exists($php) && is_executable($php)) {
|
||||
$version = `$php -v`;
|
||||
$version = `$php -n -v`;
|
||||
if (strstr($version, "(cli)")) {
|
||||
/* that's cli */
|
||||
$cli = true;
|
||||
|
@ -7,15 +7,12 @@ using invalid combinations of cmdline options
|
||||
|
||||
$php = getenv('TEST_PHP_EXECUTABLE');
|
||||
|
||||
var_dump(`$php -n -c -r "echo hello;"`);
|
||||
var_dump(`$php -n -a -r "echo hello;"`);
|
||||
var_dump(`$php -n -r "echo hello;" -a`);
|
||||
|
||||
echo "Done\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
You cannot use both -n and -c switch. Use -h for help.
|
||||
NULL
|
||||
Either execute direct code, process stdin or use a file.
|
||||
NULL
|
||||
Either execute direct code, process stdin or use a file.
|
||||
|
@ -13,10 +13,10 @@ if (substr(PHP_OS, 0, 3) == 'WIN') {
|
||||
$php = getenv('TEST_PHP_EXECUTABLE');
|
||||
|
||||
|
||||
echo `"$php" --version | grep built:`;
|
||||
echo `echo "<?php print_r(\\\$argv);" | "$php" -- foo bar baz`, "\n";
|
||||
echo `"$php" --version foo bar baz | grep built:`;
|
||||
echo `"$php" --notexisting foo bar baz | grep Usage:`;
|
||||
echo `"$php" -n --version | grep built:`;
|
||||
echo `echo "<?php print_r(\\\$argv);" | "$php" -n -- foo bar baz`, "\n";
|
||||
echo `"$php" -n --version foo bar baz | grep built:`;
|
||||
echo `"$php" -n --notexisting foo bar baz | grep Usage:`;
|
||||
|
||||
echo "Done\n";
|
||||
?>
|
||||
|
@ -14,7 +14,7 @@ $php = getenv('TEST_PHP_EXECUTABLE');
|
||||
|
||||
$filename = __DIR__.'/021.tmp.php';
|
||||
|
||||
$script = "#!$php\n".
|
||||
$script = "#!$php -n\n".
|
||||
"ola\n".
|
||||
"<?php echo 1+1,'\n';\n".
|
||||
"?>\n".
|
||||
|
Loading…
Reference in New Issue
Block a user