- changelog
[m6w6/ext-http] / tests / HttpRequest_010.phpt
1 --TEST--
2 HttpRequest cookie API
3 --SKIPIF--
4 <?php
5 include 'skip.inc';
6 checkmin(5);
7 checkcls("HttpRequest");
8 ?>
9 --FILE--
10 <?php
11 echo "-TEST\n";
12
13 $r = new HttpRequest("http://dev.iworks.at/ext-http/.cookie.php");
14
15 $r->send();
16 $c[0] = $r->getResponseInfo("cookies");
17 if (!empty($c[0])) {
18 var_dump('$c[0]', $c[0]);
19 }
20
21 var_dump($r->enableCookies());
22 $r->send();
23
24 $c[1] = $r->getResponseInfo("cookies");
25 if (empty($c[1])) {
26 var_dump('$c[1]', $c[1]);
27 }
28
29 var_dump($r->resetCookies());
30 $r->send();
31
32 $c[2] = $r->getResponseInfo("cookies");
33 if ($c[1] === $c[2]) {
34 var_dump('$c[1]', $c[1], '$c[2]', $c[2]);
35 }
36
37 $r->send();
38 $c[3] = $r->getResponseInfo("cookies");
39 if ($c[2] !== $c[3]) {
40 var_dump('$c[2]', $c[2], '$c[3]', $c[3]);
41 }
42
43 echo "Done\n";
44 --EXPECTF--
45 %sTEST
46 bool(true)
47 bool(true)
48 Done