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

Test Failure Report for sapi/cli/tests/bug67429.phpt ('FR #67429 (CLI server is missing some new HTTP response codes)')

Script

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

Expected

HTTP/1.1 308 Permanent Redirect
Connection: close
X-Powered-By: %s
Content-type: text/html; charset=UTF-8

HTTP/1.1 426 Upgrade Required
Connection: close
X-Powered-By: %s
Content-type: text/html; charset=UTF-8

Output

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

Diff

001+ Warning: fsockopen(): unable to connect to localhost:8964 (Connection refused) in /var/php_gcov/PHP_5_6/sapi/cli/tests/bug67429.php on line 13
002+ connect failed
001- HTTP/1.1 308 Permanent Redirect
002- Connection: close
003- X-Powered-By: %s
004- Content-type: text/html; charset=UTF-8
005- 
006- HTTP/1.1 426 Upgrade Required
007- Connection: close
008- X-Powered-By: %s
009- Content-type: text/html; charset=UTF-8

 

Generated at Mon, 20 Oct 2014 09:57:58 +0000 (4 days ago)

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