From: Michael Wallner Date: Mon, 23 May 2016 15:48:45 +0000 (+0200) Subject: reduce test X-Git-Tag: RELEASE_2_6_0_BETA1~28 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=c2c8bf7edb4119bcf7c837fc24516dc76af661eb;p=m6w6%2Fext-http reduce test --- diff --git a/tests/client021.phpt b/tests/client021.phpt index c31afd0..cad16e0 100644 --- a/tests/client021.phpt +++ b/tests/client021.phpt @@ -17,6 +17,12 @@ function dump($f) { readfile($f); } +function cookies($client) { + foreach ($client->getResponse()->getCookies() as $cookie) { + echo trim($cookie), "\n"; + } +} + $tmpfile = tempnam(sys_get_temp_dir(), "cookie."); $request = new http\Client\Request("GET", "http://localhost"); $request->setOptions(array("cookiestore" => $tmpfile)); @@ -24,43 +30,43 @@ $request->setOptions(array("cookiestore" => $tmpfile)); server("cookie.inc", function($port) use($request, $tmpfile) { $request->setOptions(array("port" => $port)); $client = new http\Client; - echo $client->requeue($request)->send()->getResponse(); + cookies($client->requeue($request)->send()); #dump($tmpfile); - echo $client->requeue($request)->send()->getResponse(); + cookies($client->requeue($request)->send()); #dump($tmpfile); - echo $client->requeue($request)->send()->getResponse(); + cookies($client->requeue($request)->send()); #dump($tmpfile); }); server("cookie.inc", function($port) use($request, $tmpfile) { $request->setOptions(array("port" => $port)); $client = new http\Client; - echo $client->requeue($request)->send()->getResponse(); + cookies($client->requeue($request)->send()); #dump($tmpfile); - echo $client->requeue($request)->send()->getResponse(); + cookies($client->requeue($request)->send()); #dump($tmpfile); - echo $client->requeue($request)->send()->getResponse(); + cookies($client->requeue($request)->send()); #dump($tmpfile); }); server("cookie.inc", function($port) use($request, $tmpfile) { $request->setOptions(array("port" => $port, "cookiesession" => true)); $client = new http\Client; - echo $client->requeue($request)->send()->getResponse(); + cookies($client->requeue($request)->send()); dump($tmpfile); - echo $client->requeue($request)->send()->getResponse(); + cookies($client->requeue($request)->send()); dump($tmpfile); - echo $client->requeue($request)->send()->getResponse(); + cookies($client->requeue($request)->send()); dump($tmpfile); }); server("cookie.inc", function($port) use($request, $tmpfile) { $request->setOptions(array("port" => $port, "cookiesession" => false)); $client = new http\Client; - echo $client->requeue($request)->send()->getResponse(); + cookies($client->requeue($request)->send()); dump($tmpfile); - echo $client->requeue($request)->send()->getResponse(); + cookies($client->requeue($request)->send()); dump($tmpfile); - echo $client->requeue($request)->send()->getResponse(); + cookies($client->requeue($request)->send()); dump($tmpfile); }); @@ -70,54 +76,16 @@ unlink($tmpfile); ===DONE=== --EXPECT-- Test -HTTP/1.1 200 OK -Set-Cookie: counter=1; -Etag: "" -X-Original-Transfer-Encoding: chunked -HTTP/1.1 200 OK -Set-Cookie: counter=2; -Etag: "" -X-Original-Transfer-Encoding: chunked -HTTP/1.1 200 OK -Set-Cookie: counter=3; -Etag: "" -X-Original-Transfer-Encoding: chunked -HTTP/1.1 200 OK -Set-Cookie: counter=4; -Etag: "" -X-Original-Transfer-Encoding: chunked -HTTP/1.1 200 OK -Set-Cookie: counter=5; -Etag: "" -X-Original-Transfer-Encoding: chunked -HTTP/1.1 200 OK -Set-Cookie: counter=6; -Etag: "" -X-Original-Transfer-Encoding: chunked -HTTP/1.1 200 OK -Set-Cookie: counter=1; -Etag: "" -X-Original-Transfer-Encoding: chunked -HTTP/1.1 200 OK -Set-Cookie: counter=1; -Etag: "" -X-Original-Transfer-Encoding: chunked -HTTP/1.1 200 OK -Set-Cookie: counter=1; -Etag: "" -X-Original-Transfer-Encoding: chunked -HTTP/1.1 200 OK -Set-Cookie: counter=2; -Etag: "" -X-Original-Transfer-Encoding: chunked -HTTP/1.1 200 OK -Set-Cookie: counter=3; -Etag: "" -X-Original-Transfer-Encoding: chunked -HTTP/1.1 200 OK -Set-Cookie: counter=4; -Etag: "" -X-Original-Transfer-Encoding: chunked +counter=1; +counter=2; +counter=3; +counter=4; +counter=5; +counter=6; +counter=1; +counter=1; +counter=1; +counter=2; +counter=3; +counter=4; ===DONE=== ---XFAIL-- -TBD