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

Test Failure Report for sapi/cli/tests/bug65066_511.phpt ('Bug #65066 (Cli server not responsive when responding with 422 http status code): 511 status code')

Script

1: <?php
2:
include "php_cli_server.inc";
3:
php_cli_server_start('http_response_code(511);');
4:
5: list(
$host$port) = explode(':'PHP_CLI_SERVER_ADDRESS);
6:
$port intval($port)?:80;
7:
8:
$fp fsockopen($host$port$errno$errstr0.5);
9: if (!
$fp) {
10:   die(
"connect failed");
11: }
12:
13: if(
fwrite($fp, <<<HEADER
14:
GET / HTTP/1.1
15: Host: 
{$host}
16:
17:
18:
HEADER
19: )) {
20:     while (!
feof($fp)) {
21:         echo 
fgets($fp);
22:     }
23: }
24:
?>
25:

Expected

HTTP/1.1 511 Network Authentication Required
Host: %s
Connection: close
X-Powered-By: PHP/%s
Content-type: text/html; charset=UTF-8

Output

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

Diff

001+ Warning: fsockopen(): unable to connect to localhost:8964 (Connection refused) in /var/php_gcov/PHP_HEAD/sapi/cli/tests/bug65066_511.php on line 8
002+ connect failed
001- HTTP/1.1 511 Network Authentication Required
002- Host: %s
003- Connection: close
004- X-Powered-By: PHP/%s
005- Content-type: text/html; charset=UTF-8

 

Generated at Mon, 10 Nov 2014 22:46:55 +0000 (9 days ago)

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