Skip to content

Commit a7b594d

Browse files
committed
Cookie tests
1 parent e0b72d2 commit a7b594d

File tree

2 files changed

+48
-0
lines changed

2 files changed

+48
-0
lines changed

tests/basic/022.phpt

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
--TEST--
2+
Cookies test#1
3+
--COOKIE--
4+
cookie1=val1 ; cookie2=val2%20; cookie3=val 3.; cookie 4= value 4 %3B; cookie1=bogus; %20cookie1=ignore;+cookie1=ignore;cookie1;cookie 5=%20 value; cookie%206=þæö;cookie+7=;$cookie.8;cookie-9=1;;;- & % $cookie 10=10
5+
--FILE--
6+
<?php
7+
var_dump($_COOKIE);
8+
?>
9+
--EXPECT--
10+
array(10) {
11+
["cookie1"]=>
12+
string(6) "val1 "
13+
["cookie2"]=>
14+
string(5) "val2 "
15+
["cookie3"]=>
16+
string(6) "val 3."
17+
["cookie_4"]=>
18+
string(10) " value 4 ;"
19+
["cookie__5"]=>
20+
string(7) " value"
21+
["cookie_6"]=>
22+
string(3) "þæö"
23+
["cookie_7"]=>
24+
string(0) ""
25+
["$cookie_8"]=>
26+
string(0) ""
27+
["cookie-9"]=>
28+
string(1) "1"
29+
["-_&_%_$cookie_10"]=>
30+
string(2) "10"
31+
}

tests/basic/023.phpt

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
--TEST--
2+
Cookies test#2
3+
--COOKIE--
4+
c o o k i e=value; c o o k i e= v a l u e ;;c%20o+o k+i%20e=v;name="value","value",UEhQIQ==;UEhQIQ==foo
5+
--FILE--
6+
<?php
7+
var_dump($_COOKIE);
8+
?>
9+
--EXPECT--
10+
array(3) {
11+
["c_o_o_k_i_e"]=>
12+
string(5) "value"
13+
["name"]=>
14+
string(24) ""value","value",UEhQIQ=="
15+
["UEhQIQ"]=>
16+
string(4) "=foo"
17+
}

0 commit comments

Comments
 (0)