PHP  
 PHP_5_4
downloads | QA | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | my php.net 
 

Expected Test Failure Report for sapi/cli/tests/016.phpt ('CLI -a and readline')

Script

1: <?php
2: $php 
getenv('TEST_PHP_EXECUTABLE');
3:
4:
// disallow console escape sequences that may break the output
5:
putenv('TERM=VT100');
6:
7:
$codes = array();
8:
9:
$codes[1] = <<<EOT
10:
echo 'Hello world';
11: exit
12:
EOT;
13:
14:
$codes[] = <<<EOT
15:
echo 'multine
16: single
17: quote';
18: exit
19:
EOT;
20:
21:
$codes[] = <<<EOT
22:
echo <<<HEREDOC
23: Here
24: comes
25: the
26: doc
27: HEREDOC;
28:
EOT;
29:
30:
$codes[] = <<<EOT
31:
if (0) {
32:     echo "I'm not there";
33: }
34: echo "Done";
35:
EOT;
36:
37:
$codes[] = <<<EOT
38:
function a_function_with_some_name() {
39:     echo "I was called!";
40: }
41: a_function_w    );
42:
EOT;
43:
44: foreach (
$codes as $key => $code) {
45:     echo 
"\n--------------\nSnippet no. $key:\n--------------\n";
46:     
$code escapeshellarg($code);
47:     echo `
echo $code | "$php" -a`, "\n";
48: }
49:
50: echo 
"\nDone\n";
51:
?>
52:

Expected

--------------
Snippet no. 1:
--------------
Interactive shell

php > echo 'Hello world';
Hello world
php > exit


--------------
Snippet no. 2:
--------------
Interactive shell

php > echo 'multine
php ' single
php ' quote';
multine
single
quote
php > exit


--------------
Snippet no. 3:
--------------
Interactive shell

php > echo <<<HEREDOC
<<< > Here
<<< > comes
<<< > the
<<< > doc
<<< > HEREDOC;
Here
comes
the
doc
php > 

--------------
Snippet no. 4:
--------------
Interactive shell

php > if (0) {
php {     echo "I'm not there";
php { }
php > echo "Done";
Done
php > 

--------------
Snippet no. 5:
--------------
Interactive shell

php > function a_function_with_some_name() {
php {     echo "I was called!";
php { }
php > a_function_with_some_name();
I was called!
php > 

Done

Output

--------------
Snippet no. 1:
--------------
Interactive shell

php > echo 'Hello world';
Hello worldphp > exit


--------------
Snippet no. 2:
--------------
Interactive shell

php > echo 'multine
php ' single
php ' quote';
multine
single
quotephp > exit


--------------
Snippet no. 3:
--------------
Interactive shell

php > echo <<<HEREDOC
<<< > Here
<<< > comes
<<< > the
<<< > doc
<<< > HEREDOC;
Here
comes
the
docphp > 

--------------
Snippet no. 4:
--------------
Interactive shell

php > if (0) {
php {     echo "I'm not there";
php { }
php > echo "Done";
Donephp > 

--------------
Snippet no. 5:
--------------
Interactive shell

php > function a_function_with_some_name() {
php {     echo "I was called!";
php { }
php > a_function_with_some_name();
I was called!php > 

Done

Diff

007+ Hello worldphp > exit
007- Hello world
008- php > exit
020+ quotephp > exit
021- quote
022- php > exit
037+ docphp > 
039- doc
040- php > 
048+ Donephp > 
051- Done
052- php > 
059+ I was called!php > 
063- I was called!
064- php > 

 

Generated at Sun, 20 Apr 2014 03:52:23 +0000 (3 days ago)

Copyright © 2005-2014 The PHP Group
All rights reserved.