curl interop
[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
29 $request = new http\Client\Request("GET", "http://localhost:$port?r2");
30 $client->enqueue($request);
31 $client->send();
32 dump_responses($client, ["counter" => 1]);
33 });
34
35 ?>
36 ===DONE===
37 --EXPECTF--
38 Test
39 Etag: ""
40 Set-Cookie: counter=1;
41 X-Original-Transfer-Encoding: chunked
42
43 Etag: ""
44 Set-Cookie: counter=2;
45 X-Original-Transfer-Encoding: chunked
46
47 Etag: ""
48 Set-Cookie: counter=1;
49 X-Original-Transfer-Encoding: chunked
50
51 ===DONE===