fix tests

This commit is contained in:
Jani Taskinen 2008-08-14 20:51:35 +00:00
parent ec8318b438
commit 13dff74889
7 changed files with 8 additions and 14 deletions

View File

@ -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

View File

@ -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);

View File

@ -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===

View File

@ -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;

View File

@ -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.

View 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";
?>

View File

@ -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".