Merge branch 'v2.6.x'
[m6w6/ext-http] / tests / params017.phpt
1 --TEST--
2 header params rfc5988
3 --SKIPIF--
4 <?php
5 include "skipif.inc";
6 ?>
7 --FILE--
8 <?php
9 echo "Test\n";
10
11 $link = <<<EOF
12 Link: </TheBook/chapter2>;
13 rel="previous"; title*=UTF-8'de'letztes%20Kapitel,
14 </TheBook/chapter4>;
15 rel="next"; title*=UTF-8'de'n%c3%a4chstes%20Kapitel
16 EOF;
17
18 $p = current(http\Header::parse($link, "http\\Header"))->getParams(
19 http\Params::DEF_PARAM_SEP,
20 http\Params::DEF_ARG_SEP,
21 http\Params::DEF_VAL_SEP,
22 http\Params::PARSE_RFC5988 | http\Params::PARSE_ESCAPED
23 );
24 var_dump($p->params);
25 var_dump((string)$p);
26 ?>
27 ===DONE===
28 --EXPECTF--
29 Test
30 array(2) {
31 ["/TheBook/chapter2"]=>
32 array(2) {
33 ["value"]=>
34 bool(true)
35 ["arguments"]=>
36 array(2) {
37 ["rel"]=>
38 string(8) "previous"
39 ["*rfc5987*"]=>
40 array(1) {
41 ["title"]=>
42 array(1) {
43 ["de"]=>
44 string(15) "letztes Kapitel"
45 }
46 }
47 }
48 }
49 ["/TheBook/chapter4"]=>
50 array(2) {
51 ["value"]=>
52 bool(true)
53 ["arguments"]=>
54 array(2) {
55 ["rel"]=>
56 string(4) "next"
57 ["*rfc5987*"]=>
58 array(1) {
59 ["title"]=>
60 array(1) {
61 ["de"]=>
62 string(17) "nächstes Kapitel"
63 }
64 }
65 }
66 }
67 }
68 string(139) "</TheBook/chapter2>;rel="previous";title*=utf-8'de'letztes%20Kapitel,</TheBook/chapter4>;rel="next";title*=utf-8'de'n%C3%A4chstes%20Kapitel"
69 ===DONE===