add proxy_ssl request options
[m6w6/ext-http] / tests / bug66388.phpt
index bc624dc97bb1d224c51caa8e22c94178b5db811b..df53d9c0c0d40570bc6ddcb0ab20ced21d73580e 100644 (file)
@@ -3,6 +3,8 @@ Bug #66388 (Crash on POST with Content-Length:0 and untouched body)
 --SKIPIF--
 <?php
 include "skipif.inc";
+skip_client_test();
+skip_online_test();
 ?>
 --FILE--
 <?php
@@ -10,23 +12,28 @@ include "skipif.inc";
 use http\Client,
        http\Client\Request;
 
+include "helper/server.inc";
+
 echo "Test\n";
 
-$client = new Client();
-$request = new Request(
-       'POST',
-       'https://api.twitter.com/oauth/request_token',
-       array(
-               'Content-Length' => 0
-       )
-);
-$client->enqueue($request);
-echo $client->send()->getResponse()->getResponseCode();
+server("proxy.inc", function($port) {
+       $client = new Client();
+       $request = new Request(
+               'POST',
+               "http://localhost:$port/",
+               array(
+                       'Content-Length' => 0
+               )
+       );
+       $client->setOptions(["timeout" => 30]);
+       $client->enqueue($request);
+       echo $client->send()->getResponse()->getResponseCode();
+});
 
 ?>
 
 ===DONE===
---EXPECT--
+--EXPECTF--
 Test
-401
+200
 ===DONE===