]> granicus.if.org Git - php/commitdiff
Simplify ext/standard/tests/http/bug73297.phpt
authorRowan Collins <rowan.collins@gmail.com>
Mon, 24 Oct 2016 18:01:17 +0000 (18:01 +0000)
committerJulien Pauli <jpauli@php.net>
Thu, 17 Nov 2016 10:51:53 +0000 (11:51 +0100)
ext/standard/tests/http/bug73297.phpt

index 3575ccbcaa703ad422d960c8ac1f8f292b11d0a0..0b0e02f3fd0286e4361993a3c0f1215c4fa6a56d 100644 (file)
@@ -8,34 +8,26 @@ allow_url_fopen=1
 <?php
 require 'server.inc';
 
-$ctx = stream_context_create();
-
-function do_test() {
-  $options = [
-    'http' => [
-      'protocol_version' => '1.1',
-      'header' => 'Connection: Close'
-    ],
-  ];
-
-  $ctx = stream_context_create($options);
-
-  $responses = [
-    "data://text/plain,HTTP/1.1 100 Continue\r\n\r\nHTTP/1.1 200 OK\r\n\r\n"
-      . "Hello"
-  ];
-  $pid = http_server('tcp://127.0.0.1:12342', $responses);
-
-  echo file_get_contents('http://127.0.0.1:12342/', false, $ctx);
-  echo "\n";
-
-  http_server_kill($pid);
-}
-
-do_test();
+$options = [
+  'http' => [
+    'protocol_version' => '1.1',
+    'header' => 'Connection: Close'
+  ],
+];
+
+$ctx = stream_context_create($options);
+
+$responses = [
+  "data://text/plain,HTTP/1.1 100 Continue\r\n\r\nHTTP/1.1 200 OK\r\n\r\n"
+    . "Hello"
+];
+$pid = http_server('tcp://127.0.0.1:12342', $responses);
+
+echo file_get_contents('http://127.0.0.1:12342/', false, $ctx);
 echo "\n";
 
+http_server_kill($pid);
+
 ?>
 --EXPECT--
 Hello
-