Skip to content

Commit eba5e27

Browse files
IMSoPJulien Pauli
authored andcommitted
Simplify ext/standard/tests/http/bug73297.phpt
1 parent aec1a5e commit eba5e27

File tree

1 file changed

+18
-26
lines changed

1 file changed

+18
-26
lines changed

ext/standard/tests/http/bug73297.phpt

Lines changed: 18 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -8,34 +8,26 @@ allow_url_fopen=1
88
<?php
99
require 'server.inc';
1010

11-
$ctx = stream_context_create();
12-
13-
function do_test() {
14-
$options = [
15-
'http' => [
16-
'protocol_version' => '1.1',
17-
'header' => 'Connection: Close'
18-
],
19-
];
20-
21-
$ctx = stream_context_create($options);
22-
23-
$responses = [
24-
"data://text/plain,HTTP/1.1 100 Continue\r\n\r\nHTTP/1.1 200 OK\r\n\r\n"
25-
. "Hello"
26-
];
27-
$pid = http_server('tcp://127.0.0.1:12342', $responses);
28-
29-
echo file_get_contents('http://127.0.0.1:12342/', false, $ctx);
30-
echo "\n";
31-
32-
http_server_kill($pid);
33-
}
34-
35-
do_test();
11+
$options = [
12+
'http' => [
13+
'protocol_version' => '1.1',
14+
'header' => 'Connection: Close'
15+
],
16+
];
17+
18+
$ctx = stream_context_create($options);
19+
20+
$responses = [
21+
"data://text/plain,HTTP/1.1 100 Continue\r\n\r\nHTTP/1.1 200 OK\r\n\r\n"
22+
. "Hello"
23+
];
24+
$pid = http_server('tcp://127.0.0.1:12342', $responses);
25+
26+
echo file_get_contents('http://127.0.0.1:12342/', false, $ctx);
3627
echo "\n";
3728

29+
http_server_kill($pid);
30+
3831
?>
3932
--EXPECT--
4033
Hello
41-

0 commit comments

Comments
 (0)