From: Johannes Schlüter Date: Sat, 1 Mar 2008 21:55:38 +0000 (+0000) Subject: MFH: New tests X-Git-Tag: BEFORE_NEW_PARAMETER_PARSE~719 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=95623a1d70da43a40386c9cd8583d1f7638ce694;p=php MFH: New tests --- diff --git a/sapi/cli/tests/016.phpt b/sapi/cli/tests/016.phpt new file mode 100644 index 0000000000..0b90844f37 --- /dev/null +++ b/sapi/cli/tests/016.phpt @@ -0,0 +1,105 @@ +--TEST-- +CLI -a and readline +--SKIPIF-- + +--FILE-- + $code) { + echo "\n--------------\nSnippet no. $key:\n--------------\n"; + $code = escapeshellarg($code); + echo `echo $code | "$php" -a`, "\n"; +} + +echo "\nDone\n"; +?> +--EXPECTF-- +-------------- +Snippet no. 1: +-------------- +Interactive shell + +php > Hello world +php > + +-------------- +Snippet no. 2: +-------------- +Interactive shell + +php > php ' php ' multine +single +quote +php > + +-------------- +Snippet no. 3: +-------------- +Interactive shell + +php > <<< > <<< > <<< > <<< > <<< > Here +comes +the +doc +php > + +-------------- +Snippet no. 4: +-------------- +Interactive shell + +php > php { php { php > Done +php > + +-------------- +Snippet no. 5: +-------------- +Interactive shell + +php > php { php { php > I was called! +php > + +Done diff --git a/sapi/cli/tests/017.phpt b/sapi/cli/tests/017.phpt new file mode 100644 index 0000000000..efaf977db4 --- /dev/null +++ b/sapi/cli/tests/017.phpt @@ -0,0 +1,106 @@ +--TEST-- +CLI -a and libedit +--SKIPIF-- + +--FILE-- + $code) { + echo "\n--------------\nSnippet no. $key:\n--------------\n"; + $code = escapeshellarg($code); + echo `echo $code | "$php" -a`, "\n"; +} + +echo "\nDone\n"; +?> +--EXPECTF-- +-------------- +Snippet no. 1: +-------------- +Interactive shell + +Hello world + + +-------------- +Snippet no. 2: +-------------- +Interactive shell + +multine +single +quote + + +-------------- +Snippet no. 3: +-------------- +Interactive shell + +Here +comes +the +doc + + +-------------- +Snippet no. 4: +-------------- +Interactive shell + +Done + + +-------------- +Snippet no. 5: +-------------- +Interactive shell + + +Parse error: syntax error, unexpected ')' in php shell code on line 1 + + +Done