Skip to content

Commit 60b08d6

Browse files
cmb69charmitro
authored andcommitted
gh15937.phpt does not need to be an online test
We convert the test to use the CLI test server to not require online availability. As of PHP 8.3, the test is supposed to fail, because the timeout is too large. Since exactly this scenario is already tested by gh16810.phpt, we drop the test for PHP-8.3 and up. Closes phpGH-17315.
1 parent 412e078 commit 60b08d6

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed
Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,22 @@
11
--TEST--
22
GH-15937 (stream overflow on timeout setting)
3-
--SKIPIF--
4-
<?php if (getenv("SKIP_ONLINE_TESTS")) die("skip online test"); ?>
53
--FILE--
64
<?php
5+
$serverCode = <<<'CODE'
6+
echo 1;
7+
CODE;
8+
9+
include __DIR__."/../../../../sapi/cli/tests/php_cli_server.inc";
10+
php_cli_server_start($serverCode, null, []);
11+
12+
$uri = "http://" . PHP_CLI_SERVER_ADDRESS . '/test';
713
$config = [
814
'http' => [
915
'timeout' => PHP_INT_MAX,
1016
],
1117
];
1218
$ctx = stream_context_create($config);
13-
var_dump(fopen("http://www.example.com", "r", false, $ctx));
19+
var_dump(fopen("http://" . PHP_CLI_SERVER_ADDRESS . "/test", "r", false, $ctx));
1420
?>
1521
--EXPECTF--
1622
resource(%d) of type (stream)

0 commit comments

Comments
 (0)