prepare v4.2.5
[m6w6/ext-http] / tests / client027.phpt
1 --TEST--
2 client cookie woes
3 --SKIPIF--
4 <?php
5 include "skipif.inc";
6 skip_client_test();
7 ?>
8 --FILE--
9 <?php
10
11 include "helper/server.inc";
12 include "helper/dump.inc";
13
14 echo "Test\n";
15
16 server("cookie.inc", function($port) {
17 $client = new http\Client(null, "cookies");
18 $client->configure(array("pipelining" => false, "share_cookies" => false));
19
20 $request = new http\Client\Request("GET", "http://localhost:$port?r1");
21 $client->enqueue($request);
22 $client->send();
23 dump_responses($client, ["counter" => 1]);
24
25 $client->requeue($request);
26 $client->send();
27 dump_responses($client, ["counter" => 2]);
28 $client->dequeue($request);
29
30 $request = new http\Client\Request("GET", "http://localhost:$port?r2");
31 $client->enqueue($request);
32 $client->send();
33 dump_responses($client, ["counter" => 1]);
34 });
35
36 ?>
37 ===DONE===
38 --EXPECTF--
39 Test
40 Etag: ""
41 Set-Cookie: counter=1;
42 X-Original-Transfer-Encoding: chunked
43
44 Etag: ""
45 Set-Cookie: counter=2;
46 X-Original-Transfer-Encoding: chunked
47
48 Etag: ""
49 Set-Cookie: counter=1;
50 X-Original-Transfer-Encoding: chunked
51
52 ===DONE===