Annotation of embedaddon/php/sapi/cli/tests/016.phpt, revision 1.1.1.2
1.1 misho 1: --TEST--
2: CLI -a and readline
3: --SKIPIF--
4: <?php
5: include "skipif.inc";
6: if (!extension_loaded('readline') || readline_info('done') === NULL) {
7: die ("skip need readline support");
8: }
9: ?>
10: --FILE--
11: <?php
12: $php = getenv('TEST_PHP_EXECUTABLE');
13:
14: // disallow console escape sequences that may break the output
15: putenv('TERM=VT100');
16:
17: $codes = array();
18:
19: $codes[1] = <<<EOT
20: echo 'Hello world';
21: exit
22: EOT;
23:
24: $codes[] = <<<EOT
25: echo 'multine
26: single
27: quote';
28: exit
29: EOT;
30:
31: $codes[] = <<<EOT
32: echo <<<HEREDOC
33: Here
34: comes
35: the
36: doc
37: HEREDOC;
38: EOT;
39:
40: $codes[] = <<<EOT
41: if (0) {
42: echo "I'm not there";
43: }
44: echo "Done";
45: EOT;
46:
47: $codes[] = <<<EOT
48: function a_function_with_some_name() {
49: echo "I was called!";
50: }
51: a_function_w );
52: EOT;
53:
54: foreach ($codes as $key => $code) {
55: echo "\n--------------\nSnippet no. $key:\n--------------\n";
56: $code = escapeshellarg($code);
57: echo `echo $code | "$php" -a`, "\n";
58: }
59:
60: echo "\nDone\n";
61: ?>
1.1.1.2 ! misho 62: --XFAIL--
! 63: https://bugs.php.net/bug.php?id=55496
1.1 misho 64: --EXPECTF--
65: --------------
66: Snippet no. 1:
67: --------------
68: Interactive shell
69:
70: php > echo 'Hello world';
71: Hello world
72: php > exit
73:
74:
75: --------------
76: Snippet no. 2:
77: --------------
78: Interactive shell
79:
80: php > echo 'multine
81: php ' single
82: php ' quote';
83: multine
84: single
85: quote
86: php > exit
87:
88:
89: --------------
90: Snippet no. 3:
91: --------------
92: Interactive shell
93:
94: php > echo <<<HEREDOC
95: <<< > Here
96: <<< > comes
97: <<< > the
98: <<< > doc
99: <<< > HEREDOC;
100: Here
101: comes
102: the
103: doc
104: php >
105:
106: --------------
107: Snippet no. 4:
108: --------------
109: Interactive shell
110:
111: php > if (0) {
112: php { echo "I'm not there";
113: php { }
114: php > echo "Done";
115: Done
116: php >
117:
118: --------------
119: Snippet no. 5:
120: --------------
121: Interactive shell
122:
123: php > function a_function_with_some_name() {
124: php { echo "I was called!";
125: php { }
126: php > a_function_with_some_name();
127: I was called!
128: php >
129:
130: Done
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>