Possible null pointer dereference in php_http_url_mod() fixed.
[m6w6/ext-http] / tests / cookie010.phpt
1 --TEST--
2 cookies flags
3 --SKIPIF--
4 <?php
5 include "skipif.inc";
6 ?>
7 --FILE--
8 <?php
9 echo "Test\n";
10
11 $c = new http\Cookie("icanhas=flags; secure; httpOnly");
12 var_dump(http\Cookie::SECURE === ($c->getFlags() & http\Cookie::SECURE));
13 var_dump(http\Cookie::HTTPONLY === ($c->getFlags() & http\Cookie::HTTPONLY));
14 $c->setFlags($c->getFlags() ^ http\Cookie::SECURE);
15 var_dump(!($c->getFlags() & http\Cookie::SECURE));
16 var_dump(http\Cookie::HTTPONLY === ($c->getFlags() & http\Cookie::HTTPONLY));
17 $c->setFlags($c->getFlags() ^ http\Cookie::HTTPONLY);
18 var_dump(!($c->getFlags() & http\Cookie::SECURE));
19 var_dump(!($c->getFlags() & http\Cookie::HTTPONLY));
20 var_dump("icanhas=flags; " === $c->toString());
21 $c->setFlags(http\Cookie::SECURE|http\Cookie::HTTPONLY);
22 var_dump("icanhas=flags; secure; httpOnly; " === $c->toString());
23 ?>
24 DONE
25 --EXPECT--
26 Test
27 bool(true)
28 bool(true)
29 bool(true)
30 bool(true)
31 bool(true)
32 bool(true)
33 bool(true)
34 bool(true)
35 DONE