PHP  
 PHP_7_1
downloads | QA | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | my php.net 
 

Test Failure Report for ext/standard/tests/url/get_headers_error_003.phpt ('Test get_headers() function : test with context')

Script

1: <?php
2:
3:
include dirname(__FILE__)."/../../../../sapi/cli/tests/php_cli_server.inc";
4:
php_cli_server_start('header("X-Request-Method: ".$_SERVER["REQUEST_METHOD"]);');
5:
6:
$opts = array(
7:   
'http' => array(
8:     
'method' => 'HEAD'
9:   
)
10: );
11:
12:
$context stream_context_create($opts);
13:
$headers get_headers("http://".PHP_CLI_SERVER_ADDRESS1$context);
14: echo 
$headers["X-Request-Method"]."\n";
15:
16:
stream_context_set_default($opts);
17:
$headers get_headers("http://".PHP_CLI_SERVER_ADDRESS1);
18: echo 
$headers["X-Request-Method"]."\n";
19:
20: echo 
"Done";
21:
?>
22:

Expected

HEAD
HEAD
Done

Output

Unable to connect to server

Diff

001+ Unable to connect to server
001- HEAD
002- HEAD
003- Done

 

Generated at Fri, 17 Nov 2017 10:18:10 +0000 (12 hours ago)

Copyright © 2005-2017 The PHP Group
All rights reserved.