X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-http;a=blobdiff_plain;f=tests%2Fbug66388.phpt;h=df53d9c0c0d40570bc6ddcb0ab20ced21d73580e;hp=9f9c95e9ed1aa723fe3b41c717e0850b9715f10c;hb=4d376d38ec260d4fd467bb95b41451bf645d92e4;hpb=eaa046dc3e6496e523a17c3b786ef27067b9795c diff --git a/tests/bug66388.phpt b/tests/bug66388.phpt index 9f9c95e..df53d9c 100644 --- a/tests/bug66388.phpt +++ b/tests/bug66388.phpt @@ -3,6 +3,7 @@ Bug #66388 (Crash on POST with Content-Length:0 and untouched body) --SKIPIF-- --FILE-- @@ -11,23 +12,28 @@ 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->setOptions(["timeout" => 30]); + $client->enqueue($request); + echo $client->send()->getResponse()->getResponseCode(); +}); ?> ===DONE=== ---EXPECT-- +--EXPECTF-- Test -401 +200 ===DONE===