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

Test Failure Report for sapi/cli/tests/bug43177.phpt ('Bug #61977 Test exit code for various errors')

Script

1: <?php
2:
include "php_cli_server.inc";
3:
php_cli_server_start(<<<'SCRIPT'
4:
    ini_set('display_errors', 0);
5:     switch($_SERVER["REQUEST_URI"]) {
6:             case "/parse":
7:                     eval("this is a parse error");
8:                     echo "OK\n";
9:                     break;
10:             case "/fatal":
11:                     eval("foo();");
12:                     echo "OK\n";
13:                     break;
14:             case "/compile":
15:                     eval("class foo { final private final function bar() {} }");
16:                     echo "OK\n";
17:                     break;
18:             case "/fatal2":
19:                     foo();
20:                     echo "OK\n";
21:                     break;
22:             default:
23:                     return false;
24:     }
25:
SCRIPT
26: );
27:
28: list(
$host$port) = explode(':'PHP_CLI_SERVER_ADDRESS);
29:
$port intval($port)?:80;
30:
31: foreach(array(
"parse""fatal""fatal2""compile") as $url) {
32:     
$fp fsockopen($host$port$errno$errstr0.5);
33:     if (!
$fp) {
34:           die(
"connect failed");
35:     }
36:
37:     if(
fwrite($fp, <<<HEADER
38:
GET /$url HTTP/1.1
39: Host: 
{$host}
40:
41:
42:
HEADER
43: )) {
44:         while (!
feof($fp)) {
45:                 echo 
fgets($fp);
46:         }
47:     }
48: }
49:
50:
?>
51:

Expected

HTTP/1.1 200 OK
Host: localhost
Connection: close
X-Powered-By: %s
Content-type: text/html

OK
HTTP/1.0 500 Internal Server Error
Host: localhost
Connection: close
X-Powered-By: %s
Content-type: text/html

HTTP/1.0 500 Internal Server Error
Host: localhost
Connection: close
X-Powered-By: %s
Content-type: text/html

HTTP/1.0 500 Internal Server Error
Host: localhost
Connection: close
X-Powered-By: %s
Content-type: text/html

Output

Warning: fsockopen(): unable to connect to localhost:8964 (Connection refused) in /var/php_gcov/PHP_5_4/sapi/cli/tests/bug43177.php on line 32
connect failed

Diff

001+ Warning: fsockopen(): unable to connect to localhost:8964 (Connection refused) in /var/php_gcov/PHP_5_4/sapi/cli/tests/bug43177.php on line 32
002+ connect failed
001- HTTP/1.1 200 OK
002- Host: localhost
003- Connection: close
004- X-Powered-By: %s
005- Content-type: text/html
006- 
007- OK
008- HTTP/1.0 500 Internal Server Error
009- Host: localhost
010- Connection: close
011- X-Powered-By: %s
012- Content-type: text/html
013- 
014- HTTP/1.0 500 Internal Server Error
015- Host: localhost
016- Connection: close
017- X-Powered-By: %s
018- Content-type: text/html
019- 
020- HTTP/1.0 500 Internal Server Error
021- Host: localhost
022- Connection: close
023- X-Powered-By: %s
024- Content-type: text/html

 

Generated at Sun, 17 Aug 2014 15:22:07 +0000 (6 days ago)

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