Skip to content

Commit 5b72f12

Browse files
committed
Rewrite http gh16810 test to not be online
Closes GH-17314
1 parent 3606701 commit 5b72f12

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

ext/standard/tests/http/gh16810.phpt

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,23 @@
11
--TEST--
2-
Bug #79265 variation: "host:" not at start of header
2+
GH-16809 (fopen HTTP wrapper timeout stream context option overflow)
33
--INI--
44
allow_url_fopen=1
55
--SKIPIF--
66
<?php if (PHP_INT_SIZE != 8) die("skip this test is for 64bit platform only"); ?>
77
--FILE--
88
<?php
9-
$uri = "http://www.example.com";
9+
$serverCode = <<<'CODE'
10+
echo 1;
11+
CODE;
12+
13+
include __DIR__."/../../../../sapi/cli/tests/php_cli_server.inc";
14+
php_cli_server_start($serverCode, null, []);
15+
16+
$uri = "http://" . PHP_CLI_SERVER_ADDRESS . '/test';
1017
$config = [
11-
'http' => [
12-
'timeout' => PHP_INT_MIN,
13-
],
18+
'http' => [
19+
'timeout' => PHP_INT_MIN,
20+
],
1421
];
1522
$ctx = stream_context_create($config);
1623
var_dump(fopen($uri, "r", false, $ctx));
@@ -22,5 +29,5 @@ var_dump(fopen($uri, "r", false, $ctx));
2229
--EXPECTF--
2330
resource(%d) of type (stream)
2431

25-
Warning: fopen(http://www.example.com): Failed to open stream: timeout must be lower than %d in %s on line %d
32+
Warning: fopen(http://%s): Failed to open stream: timeout must be lower than %d in %s on line %d
2633
bool(false)

0 commit comments

Comments
 (0)