mirror of
https://github.com/php/web-qa.git
synced 2026-03-24 07:22:07 +01:00
Cf. <http://git.php.net/?p=php-src.git;a=commit;h=c0e15a3b7fef5b341eb96e0e888f180ba7a39570>
50 lines
1.2 KiB
PHP
50 lines
1.2 KiB
PHP
<?php
|
|
include("../include/functions.php");
|
|
|
|
$TITLE = "Sample Test [PHP-QAT: Quality Assurance Team]";
|
|
$SITE_UPDATE = date("D M d H:i:s Y T", filectime(__FILE__));
|
|
|
|
common_header();
|
|
?>
|
|
|
|
<div style="padding: 10px">
|
|
<h1>Sample Test: conflicts_1.phpt</h1>
|
|
<p>Back to "<a href="../phpt_details.php">PHPT Test File Layout</a>"</p>
|
|
<pre>--TEST--
|
|
Test get_headers() function : test with context
|
|
--CONFLICTS--
|
|
server
|
|
--FILE--
|
|
<?php
|
|
|
|
include __DIR__."/../../../../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
|
|
</pre>
|
|
<p>Back to "<a href="../phpt_details.php">PHPT Test File Layout</a>"</p>
|
|
</div>
|
|
|
|
<?php
|
|
common_footer();
|
|
?>
|