X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-http;a=blobdiff_plain;f=tests%2Fclient010.phpt;h=0c25c1638cf70eccff6930b73acf1b621cd51538;hp=803403f4686366fb78fc83728b07f39cdcb908a6;hb=cbfdc466d8a364445ba3389e876b7c7e7f0189b2;hpb=d739650057f4ca2fc67f1ae2bfd1d24c3f2f9e7b diff --git a/tests/client010.phpt b/tests/client010.phpt index 803403f..0c25c16 100644 --- a/tests/client010.phpt +++ b/tests/client010.phpt @@ -3,11 +3,14 @@ client upload --SKIPIF-- --FILE-- client010\.php \[type\] \=\> text\/plain - \[tmp_name\] \=\> .+ - \[error\] \=\> 0 \[size\] \=\> \d+ \) \) )+/'; -$request = new http\Client\Request("POST", "http://dev.iworks.at/ext-http/.print_request.php"); -$request->getBody()->addForm(null, array("file"=>__FILE__, "name"=>"upload", "type"=>"text/plain")); -foreach (http\Client::getAvailableDrivers() as $driver) { - $client = new http\Client($driver); - $client->enqueue($request)->send(); - if (!preg_match($RE, $s = $client->getResponse()->getBody()->toString())) { - echo($s); +server("env.inc", function($port) use($RE) { + + $request = new http\Client\Request("POST", "http://localhost:$port"); + $request->getBody()->addForm(null, array("file"=>__FILE__, "name"=>"upload", "type"=>"text/plain")); + + foreach (http\Client::getAvailableDrivers() as $driver) { + $client = new http\Client($driver); + $client->enqueue($request)->send(); + if (!preg_match($RE, $s = $client->getResponse()->getBody()->toString())) { + echo($s); + } } -} +}); ?> Done --EXPECT-- Test -Done \ No newline at end of file +Done