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

1.1       misho       1: --TEST--
                      2: Bug #60523 (PHP Errors are not reported in browsers using built-in SAPI)
                      3: --SKIPIF--
                      4: <?php
                      5: include "skipif.inc"; 
                      6: ?>
                      7: --INI--
                      8: display_errors=1
                      9: --FILE--
                     10: <?php
                     11: include "php_cli_server.inc";
                     12: php_cli_server_start('require("syntax_error.php");');
                     13: $dir = realpath(dirname(__FILE__));
                     14: 
                     15: file_put_contents($dir . "/syntax_error.php", "<?php non_exists_function(); ?>");
                     16: 
                     17: list($host, $port) = explode(':', PHP_CLI_SERVER_ADDRESS);
                     18: $port = intval($port)?:80;
                     19: $output = '';
                     20: 
                     21: $fp = fsockopen($host, $port, $errno, $errstr, 0.5);
                     22: if (!$fp) {
                     23:   die("connect failed");
                     24: }
                     25: 
                     26: if(fwrite($fp, <<<HEADER
                     27: GET /index.php HTTP/1.1
                     28: Host: {$host}
                     29: 
                     30: 
                     31: HEADER
                     32: )) {
                     33:        while (!feof($fp)) {
                     34:                $output .= fgets($fp);
                     35:        }
                     36: }
                     37: echo $output;
                     38: @unlink($dir . "/syntax_error.php");
                     39: fclose($fp);
                     40: ?>
                     41: --EXPECTF--
                     42: HTTP/1.1 200 OK
                     43: Host: %s
                     44: Connection: close
                     45: X-Powered-By: PHP/%s
                     46: Content-type: text/html
                     47: 
                     48: <br />
                     49: <b>Fatal error</b>:  Call to undefined function non_exists_function() in <b>%ssyntax_error.php</b> on line <b>%s</b><br />

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