com php-src: Add tests for sapi/cli option combinations: sapi/cli/tests/012-2.phpt
| From: | Joe Watkins | Date: | Wed, 06 Sep 2017 08:54:00 +0000 |
| Subject: | com php-src: Add tests for sapi/cli option combinations: sapi/cli/tests/012-2.phpt | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-99280@lists.php.net to get a copy of this message | ||
Commit: fafd67cb71e2d47f7cae3a74d9371fe6cda55442
Author: Jansen Price <jansen.price@gmail.com> Mon, 4 Sep 2017 21:56:42 -0500
Committer: Joe Watkins <krakjoe@php.net> Wed, 6 Sep 2017 09:54:00 +0100
Parents: 9b776156080f6243ad450507c83c53e779a190cc
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=fafd67cb71e2d47f7cae3a74d9371fe6cda55442
Log:
Add tests for sapi/cli option combinations
Changed paths:
A sapi/cli/tests/012-2.phpt
Diff:
diff --git a/sapi/cli/tests/012-2.phpt b/sapi/cli/tests/012-2.phpt
new file mode 100644
index 0000000..7d2320c
--- /dev/null
+++ b/sapi/cli/tests/012-2.phpt
@@ -0,0 +1,52 @@
+--TEST--
+more invalid arguments and error messages
+--SKIPIF--
+<?php include "skipif.inc"; ?>
+--FILE--
+<?php
+
+$php = getenv('TEST_PHP_EXECUTABLE');
+
+// -r : behavior = CLI_DIRECT
+// -F / -R / -B / -E : behavior = PROCESS_STDIN
+// -l : behavior = LINT
+// -s : behavior = HIGHLIGHT
+// -w : behavior = STRIP
+
+var_dump(
"$php" -n -r 'echo 1;' -F some.php);
+var_dump("$php" -n -r 'echo 2;' -f some.php);
+var_dump("$php" -n -r 'echo 3;' -l); // ignores linting
+var_dump("$php" -n -r 'echo 4;' -R some.php);
+var_dump("$php" -n -r 'echo 5;' -B '');
+var_dump("$php" -n -a -B '');
+var_dump("$php" -n -r 'echo 6;' -E '');
+var_dump("$php" -n -a -E '');
+var_dump("$php" -n -r 'echo 7;' -s);
+var_dump("$php" -n -r 'echo 8;' -w);
+var_dump("$php" -n -l -r 'echo 9;');
+
+echo "Done\n";
+?>
+--EXPECTF--
+string(57) "Either execute direct code, process stdin or use a file.
+"
+string(57) "Either execute direct code, process stdin or use a file.
+"
+string(1) "3"
+string(57) "Either execute direct code, process stdin or use a file.
+"
+string(57) "Either execute direct code, process stdin or use a file.
+"
+string(57) "Either execute direct code, process stdin or use a file.
+"
+string(57) "Either execute direct code, process stdin or use a file.
+"
+string(57) "Either execute direct code, process stdin or use a file.
+"
+string(42) "Source highlighting only works for files.
+"
+string(39) "Source stripping only works for files.
+"
+string(57) "Either execute direct code, process stdin or use a file.
+"
+Done