From 95623a1d70da43a40386c9cd8583d1f7638ce694 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Johannes=20Schl=C3=BCter?= Date: Sat, 1 Mar 2008 21:55:38 +0000 Subject: [PATCH] MFH: New tests --- sapi/cli/tests/016.phpt | 105 +++++++++++++++++++++++++++++++++++++++ sapi/cli/tests/017.phpt | 106 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 211 insertions(+) create mode 100644 sapi/cli/tests/016.phpt create mode 100644 sapi/cli/tests/017.phpt 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 -- 2.40.0