don't rely on external services (tm)
authorMichael Wallner <mike@php.net>
Mon, 7 Sep 2015 11:42:25 +0000 (13:42 +0200)
committerMichael Wallner <mike@php.net>
Mon, 7 Sep 2015 11:42:25 +0000 (13:42 +0200)
tests/bug66388.phpt

index e4cbf2ace925966ab1964cfdc92cf1a0b4167148..77d50c7349384823b71ed5f7272a343a2ca1cdd6 100644 (file)
@@ -11,23 +11,27 @@ skip_online_test();
 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->enqueue($request);
+       echo $client->send()->getResponse()->getResponseCode();
+});
 
 ?>
 
 ===DONE===
 --EXPECTF--
 Test
-40%d
+200
 ===DONE===