1
0
mirror of https://github.com/php/php-src.git synced 2026-04-19 14:01:01 +02:00
Files
archived-php-src/ext/standard/tests/url/get_headers_error_003.phpt
Gabriel Caruso ded3d984c6 Use EXPECT instead of EXPECTF when possible
EXPECTF logic in run-tests.php is considerable, so let's avoid it.
2018-02-20 21:53:48 +01:00

32 lines
632 B
PHP

--TEST--
Test get_headers() function : test with context
--FILE--
<?php
include dirname(__FILE__)."/../../../../sapi/cli/tests/php_cli_server.inc";
php_cli_server_start('header("X-Request-Method: ".$_SERVER["REQUEST_METHOD"]);');
$opts = array(
'http' => array(
'method' => 'HEAD'
)
);
$context = stream_context_create($opts);
$headers = get_headers("http://".PHP_CLI_SERVER_ADDRESS, 1, $context);
echo $headers["X-Request-Method"]."\n";
stream_context_set_default($opts);
$headers = get_headers("http://".PHP_CLI_SERVER_ADDRESS, 1);
echo $headers["X-Request-Method"]."\n";
echo "Done";
?>
--EXPECT--
HEAD
HEAD
Done