Annotation of embedaddon/php/sapi/cli/tests/bug65066_511.phpt, revision 1.1.1.1

1.1       misho       1: --TEST--
                      2: Bug #65066 (Cli server not responsive when responding with 422 http status code): 511 status code
                      3: --INI--
                      4: allow_url_fopen=1
                      5: --SKIPIF--
                      6: <?php
                      7: include "skipif.inc"; 
                      8: ?>
                      9: --FILE--
                     10: <?php
                     11: include "php_cli_server.inc";
                     12: php_cli_server_start('http_response_code(511);');
                     13: 
                     14: list($host, $port) = explode(':', PHP_CLI_SERVER_ADDRESS);
                     15: $port = intval($port)?:80;
                     16: 
                     17: $fp = fsockopen($host, $port, $errno, $errstr, 0.5);
                     18: if (!$fp) {
                     19:   die("connect failed");
                     20: }
                     21: 
                     22: if(fwrite($fp, <<<HEADER
                     23: GET / HTTP/1.1
                     24: Host: {$host}
                     25: 
                     26: 
                     27: HEADER
                     28: )) {
                     29:        while (!feof($fp)) {
                     30:                echo fgets($fp);
                     31:        }
                     32: }
                     33: ?>
                     34: --EXPECTF--
                     35: HTTP/1.1 511 Network Authentication Required
                     36: Host: %s
                     37: Connection: close
                     38: X-Powered-By: PHP/%s
                     39: Content-type: text/html

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>