Skip to content

Commit fafd67c

Browse files
Jansen Pricekrakjoe
authored andcommitted
Add tests for sapi/cli option combinations
1 parent 9b77615 commit fafd67c

File tree

1 file changed

+52
-0
lines changed

1 file changed

+52
-0
lines changed

sapi/cli/tests/012-2.phpt

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
--TEST--
2+
more invalid arguments and error messages
3+
--SKIPIF--
4+
<?php include "skipif.inc"; ?>
5+
--FILE--
6+
<?php
7+
8+
$php = getenv('TEST_PHP_EXECUTABLE');
9+
10+
// -r : behavior = CLI_DIRECT
11+
// -F / -R / -B / -E : behavior = PROCESS_STDIN
12+
// -l : behavior = LINT
13+
// -s : behavior = HIGHLIGHT
14+
// -w : behavior = STRIP
15+
16+
var_dump(`"$php" -n -r 'echo 1;' -F some.php`);
17+
var_dump(`"$php" -n -r 'echo 2;' -f some.php`);
18+
var_dump(`"$php" -n -r 'echo 3;' -l`); // ignores linting
19+
var_dump(`"$php" -n -r 'echo 4;' -R some.php`);
20+
var_dump(`"$php" -n -r 'echo 5;' -B ''`);
21+
var_dump(`"$php" -n -a -B ''`);
22+
var_dump(`"$php" -n -r 'echo 6;' -E ''`);
23+
var_dump(`"$php" -n -a -E ''`);
24+
var_dump(`"$php" -n -r 'echo 7;' -s`);
25+
var_dump(`"$php" -n -r 'echo 8;' -w`);
26+
var_dump(`"$php" -n -l -r 'echo 9;'`);
27+
28+
echo "Done\n";
29+
?>
30+
--EXPECTF--
31+
string(57) "Either execute direct code, process stdin or use a file.
32+
"
33+
string(57) "Either execute direct code, process stdin or use a file.
34+
"
35+
string(1) "3"
36+
string(57) "Either execute direct code, process stdin or use a file.
37+
"
38+
string(57) "Either execute direct code, process stdin or use a file.
39+
"
40+
string(57) "Either execute direct code, process stdin or use a file.
41+
"
42+
string(57) "Either execute direct code, process stdin or use a file.
43+
"
44+
string(57) "Either execute direct code, process stdin or use a file.
45+
"
46+
string(42) "Source highlighting only works for files.
47+
"
48+
string(39) "Source stripping only works for files.
49+
"
50+
string(57) "Either execute direct code, process stdin or use a file.
51+
"
52+
Done

0 commit comments

Comments
 (0)