php-src/sapi/cli/tests/php_cli_server_022.phpt
George Peter Banyard 3bf4098eee
Refactor (again) CLI SAPI server_client struct to use zend_string* (#8605)
This time in a way which works under a RC Debug build.
2022-05-30 13:03:23 +01:00

45 lines
607 B
PHP

--TEST--
Check PHP file body is executed
--SKIPIF--
<?php
include "skipif.inc";
?>
--FILE--
<?php
include "php_cli_server.inc";
php_cli_server_start(<<<'PHP'
header('Bar-Foo: Foo');
echo "Hello world\n";
var_dump(true);
PHP
);
$host = PHP_CLI_SERVER_HOSTNAME;
$fp = php_cli_server_connect();
if(fwrite($fp, <<<HEADER
GET / HTTP/1.1
Host: {$host}
Foo-Bar: Bar
HEADER
)) {
while (!feof($fp)) {
echo fgets($fp);
}
}
fclose($fp);
?>
--EXPECTF--
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
Hello world
bool(true)