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, $errstr, 0.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
Date: %s
Connection: close
X-Powered-By: %s
Bar-Foo: Foo
Content-type: text/html; charset=UTF-8
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(24) "text/html; charset=UTF-8"
}
Output
Unable to connect to server
Diff
001+ Unable to connect to server
001- HTTP/1.1 200 OK
002- Host: %s
003- Date: %s
004- Connection: close
005- X-Powered-By: %s
006- Bar-Foo: Foo
007- Content-type: text/html; charset=UTF-8
008-
009- array(2) {
010- ["Host"]=>
011- string(9) "localhost"
012- ["Foo-Bar"]=>
013- string(3) "Bar"
014- }
015- array(2) {
016- ["Host"]=>
017- string(9) "localhost"
018- ["Foo-Bar"]=>
019- string(3) "Bar"
020- }
021- array(3) {
022- ["X-Powered-By"]=>
023- string(%d) "P%s"
024- ["Bar-Foo"]=>
025- string(3) "Foo"
026- ["Content-type"]=>
027- string(24) "text/html; charset=UTF-8"
028- }
Generated at Thu, 21 Feb 2019 22:06:51 +0000 (47 hours ago)
|