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

Test Failure Report for sapi/cli/tests/php_cli_server_019.phpt ('Implement Req #65917 (getallheaders() is not supported by the built-in web server)')

Script

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

Expected

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

array(2) {
  ["Host"]=>
  string(9) "localhost"
  ["Foo-Bar"]=>
  string(3) "Bar"
}
array(2) {
  ["Host"]=>
  string(9) "localhost"
  ["Foo-Bar"]=>
  string(3) "Bar"
}
array(3) {
  ["X-Powered-By"]=>
  string(%d) "P%s"
  ["Bar-Foo"]=>
  string(3) "Foo"
  ["Content-type"]=>
  string(9) "text/html"
}

Output

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

Diff

001+ Warning: fsockopen(): unable to connect to localhost:8964 (Connection refused) in /var/php_gcov/PHP_5_5/sapi/cli/tests/php_cli_server_019.php on line 14
002+ connect failed
001- HTTP/1.1 200 OK
002- Host: %s
003- Connection: close
004- X-Powered-By: %s
005- Bar-Foo: Foo
006- Content-type: text/html
007- 
008- array(2) {
009-   ["Host"]=>
010-   string(9) "localhost"
011-   ["Foo-Bar"]=>
012-   string(3) "Bar"
013- }
014- array(2) {
015-   ["Host"]=>
016-   string(9) "localhost"
017-   ["Foo-Bar"]=>
018-   string(3) "Bar"
019- }
020- array(3) {
021-   ["X-Powered-By"]=>
022-   string(%d) "P%s"
023-   ["Bar-Foo"]=>
024-   string(3) "Foo"
025-   ["Content-type"]=>
026-   string(9) "text/html"
027- }

 

Generated at Mon, 17 Nov 2014 20:38:41 +0000 (6 days ago)

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