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/php_cli_server_012.phpt ('Bug #60159 (Router returns false, but POST is not passed to requested resource)')

Script

1: <?php
2:
include "php_cli_server.inc";
3:
php_cli_server_start('print_r($_REQUEST); $_REQUEST["foo"] = "bar"; return FALSE;');
4:
$doc_root __DIR__;
5:
file_put_contents($doc_root '/request.php''<?php print_r($_REQUEST); ?>');
6:
7: list(
$host$port) = explode(':'PHP_CLI_SERVER_ADDRESS);
8:
$port intval($port)?:80;
9:
10:
$fp fsockopen($host$port$errno$errstr0.5);
11: if (!
$fp) {
12:   die(
"connect failed");
13: }
14:
15: if(
fwrite($fp, <<<HEADER
16:
POST /request.php HTTP/1.1
17: Host: 
{$host}
18: Content-Type: application/x-www-form-urlencoded
19: Content-Length: 3
20:
21: a=b
22:
HEADER
23: )) {
24:     while (!
feof($fp)) {
25:         echo 
fgets($fp);
26:     }
27: }
28:
29:
fclose($fp);
30: @
unlink($doc_root '/request.php');
31:
32:
?>
33:

Expected

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

Array
(
    [a] => b
)
Array
(
    [a] => b
    [foo] => bar
)

Output

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

Diff

001+ Warning: fsockopen(): unable to connect to localhost:8964 (Connection refused) in /var/php_gcov/PHP_5_4/sapi/cli/tests/php_cli_server_012.php on line 10
002+ connect failed
001- HTTP/1.1 200 OK
002- Host: %s
003- Connection: close
004- X-Powered-By: PHP/%s
005- Content-type: text/html
006- 
007- Array
008- (
009-     [a] => b
010- )
011- Array
012- (
013-     [a] => b
014-     [foo] => bar
015- )

 

Generated at Tue, 25 Nov 2014 09:11:11 +0000 (4 days ago)

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