mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
Rewrite http gh16810 test to not be online
Closes GH-17314
This commit is contained in:
parent
3606701f48
commit
5b72f12c56
1 changed files with 13 additions and 6 deletions
|
@ -1,16 +1,23 @@
|
||||||
--TEST--
|
--TEST--
|
||||||
Bug #79265 variation: "host:" not at start of header
|
GH-16809 (fopen HTTP wrapper timeout stream context option overflow)
|
||||||
--INI--
|
--INI--
|
||||||
allow_url_fopen=1
|
allow_url_fopen=1
|
||||||
--SKIPIF--
|
--SKIPIF--
|
||||||
<?php if (PHP_INT_SIZE != 8) die("skip this test is for 64bit platform only"); ?>
|
<?php if (PHP_INT_SIZE != 8) die("skip this test is for 64bit platform only"); ?>
|
||||||
--FILE--
|
--FILE--
|
||||||
<?php
|
<?php
|
||||||
$uri = "http://www.example.com";
|
$serverCode = <<<'CODE'
|
||||||
|
echo 1;
|
||||||
|
CODE;
|
||||||
|
|
||||||
|
include __DIR__."/../../../../sapi/cli/tests/php_cli_server.inc";
|
||||||
|
php_cli_server_start($serverCode, null, []);
|
||||||
|
|
||||||
|
$uri = "http://" . PHP_CLI_SERVER_ADDRESS . '/test';
|
||||||
$config = [
|
$config = [
|
||||||
'http' => [
|
'http' => [
|
||||||
'timeout' => PHP_INT_MIN,
|
'timeout' => PHP_INT_MIN,
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
$ctx = stream_context_create($config);
|
$ctx = stream_context_create($config);
|
||||||
var_dump(fopen($uri, "r", false, $ctx));
|
var_dump(fopen($uri, "r", false, $ctx));
|
||||||
|
@ -22,5 +29,5 @@ var_dump(fopen($uri, "r", false, $ctx));
|
||||||
--EXPECTF--
|
--EXPECTF--
|
||||||
resource(%d) of type (stream)
|
resource(%d) of type (stream)
|
||||||
|
|
||||||
Warning: fopen(http://www.example.com): Failed to open stream: timeout must be lower than %d in %s on line %d
|
Warning: fopen(http://%s): Failed to open stream: timeout must be lower than %d in %s on line %d
|
||||||
bool(false)
|
bool(false)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue