Annotation of embedaddon/php/sapi/cli/tests/php_cli_server_011.phpt, revision 1.1

1.1     ! misho       1: --TEST--
        !             2: Bug #60180 ($_SERVER["PHP_SELF"] incorrect)
        !             3: --SKIPIF--
        !             4: <?php
        !             5: include "skipif.inc"; 
        !             6: ?>
        !             7: --FILE--
        !             8: <?php
        !             9: include "php_cli_server.inc";
        !            10: php_cli_server_start('sytanx error;', TRUE);
        !            11: 
        !            12: list($host, $port) = explode(':', PHP_CLI_SERVER_ADDRESS);
        !            13: $port = intval($port)?:80;
        !            14: 
        !            15: $fp = fsockopen($host, $port, $errno, $errstr, 0.5);
        !            16: if (!$fp) {
        !            17:   die("connect failed");
        !            18: }
        !            19: 
        !            20: $logo_id = php_logo_guid();
        !            21: 
        !            22: if(fwrite($fp, <<<HEADER
        !            23: GET /?={$logo_id} HTTP/1.1
        !            24: Host: {$host}
        !            25: 
        !            26: 
        !            27: HEADER
        !            28: )) {
        !            29:        while (!feof($fp)) {
        !            30:                if (("Content-Type: image/gif") ==  trim(fgets($fp))) {
        !            31:                        echo "okey";
        !            32:                        break;
        !            33:                }
        !            34:        }
        !            35: }
        !            36: 
        !            37: fclose($fp);
        !            38: 
        !            39: ?>
        !            40: --EXPECTF--
        !            41: okey

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