From: Michael Wallner Date: Fri, 12 Jul 2019 12:27:23 +0000 (+0200) Subject: add more cookie tests X-Git-Tag: RELEASE_3_2_2~12 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=70b33dfb356cc2792bbec57995f7ce687ae8f16d;p=m6w6%2Fext-http add more cookie tests --- diff --git a/tests/client031.phpt b/tests/client031.phpt new file mode 100644 index 0000000..3211735 --- /dev/null +++ b/tests/client031.phpt @@ -0,0 +1,71 @@ +--TEST-- +client cookie sharing disabled +--SKIPIF-- + +--FILE-- +configure(array("share_cookies" => false)); + $request = new http\Client\Request("GET", "http://localhost:$port"); + $client->enqueue($request); + $client->send(); + while (($r = $client->getResponse())) { + dump_headers(null, $r->getHeaders()); + } + /* requeue the previous request */ + $client->requeue($request); + $request = new http\Client\Request("GET", "http://localhost:$port"); + $client->enqueue($request); + $client->send(); + while (($r = $client->getResponse())) { + dump_headers(null, $r->getHeaders()); + } + $request = new http\Client\Request("GET", "http://localhost:$port"); + $client->enqueue($request); + $client->send(); + while (($r = $client->getResponse())) { + dump_headers(null, $r->getHeaders()); + } + $request = new http\Client\Request("GET", "http://localhost:$port"); + $client->enqueue($request); + $client->send(); + while (($r = $client->getResponse())) { + dump_headers(null, $r->getHeaders()); + } +}); + +?> +===DONE=== +--EXPECTF-- +Test +Etag: "" +Set-Cookie: counter=1; +X-Original-Transfer-Encoding: chunked + +Etag: "" +Set-Cookie: counter=1; +X-Original-Transfer-Encoding: chunked + +Etag: "" +Set-Cookie: counter=2; +X-Original-Transfer-Encoding: chunked + +Etag: "" +Set-Cookie: counter=1; +X-Original-Transfer-Encoding: chunked + +Etag: "" +Set-Cookie: counter=1; +X-Original-Transfer-Encoding: chunked + +===DONE=== diff --git a/tests/client032.phpt b/tests/client032.phpt new file mode 100644 index 0000000..d8dfb2b --- /dev/null +++ b/tests/client032.phpt @@ -0,0 +1,71 @@ +--TEST-- +client cookie sharing enabled +--SKIPIF-- + +--FILE-- +configure(array("share_cookies" => true)); + $request = new http\Client\Request("GET", "http://localhost:$port"); + $client->enqueue($request); + $client->send(); + while (($r = $client->getResponse())) { + dump_headers(null, $r->getHeaders()); + } + /* requeue the previous request */ + $client->requeue($request); + $request = new http\Client\Request("GET", "http://localhost:$port"); + $client->enqueue($request); + $client->send(); + while (($r = $client->getResponse())) { + dump_headers(null, $r->getHeaders()); + } + $request = new http\Client\Request("GET", "http://localhost:$port"); + $client->enqueue($request); + $client->send(); + while (($r = $client->getResponse())) { + dump_headers(null, $r->getHeaders()); + } + $request = new http\Client\Request("GET", "http://localhost:$port"); + $client->enqueue($request); + $client->send(); + while (($r = $client->getResponse())) { + dump_headers(null, $r->getHeaders()); + } +}); + +?> +===DONE=== +--EXPECTF-- +Test +Etag: "" +Set-Cookie: counter=1; +X-Original-Transfer-Encoding: chunked + +Etag: "" +Set-Cookie: counter=2; +X-Original-Transfer-Encoding: chunked + +Etag: "" +Set-Cookie: counter=2; +X-Original-Transfer-Encoding: chunked + +Etag: "" +Set-Cookie: counter=3; +X-Original-Transfer-Encoding: chunked + +Etag: "" +Set-Cookie: counter=4; +X-Original-Transfer-Encoding: chunked + +===DONE===