File: params016.phpt

package info (click to toggle)
php-pecl-http 3.1.0%2B2.6.0-4
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 4,060 kB
  • ctags: 3,725
  • sloc: ansic: 37,486; xml: 818; php: 635; pascal: 164; makefile: 2
file content (46 lines) | stat: -rw-r--r-- 1,077 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
--TEST--
header params rfc5988
--SKIPIF--
<?php
include "skipif.inc";
?>
--FILE--
<?php
echo "Test\n";

$link = <<<EOF
<https://api.github.com/search/code?q=addClass+user%3Amozilla&page=2>; rel="next", <https://api.github.com/search/code?q=addClass+user%3Amozilla&page=34>; rel="last"
EOF;

$p = new http\Params($link, ",", ";", "=",
	http\Params::PARSE_RFC5988 | http\Params::PARSE_ESCAPED);
var_dump($p->params);
var_dump((string)$p);
?>
===DONE===
--EXPECT--
Test
array(2) {
  ["https://api.github.com/search/code?q=addClass+user%3Amozilla&page=2"]=>
  array(2) {
    ["value"]=>
    bool(true)
    ["arguments"]=>
    array(1) {
      ["rel"]=>
      string(4) "next"
    }
  }
  ["https://api.github.com/search/code?q=addClass+user%3Amozilla&page=34"]=>
  array(2) {
    ["value"]=>
    bool(true)
    ["arguments"]=>
    array(1) {
      ["rel"]=>
      string(4) "last"
    }
  }
}
string(162) "<https://api.github.com/search/code?q=addClass+user%3Amozilla&page=2>;rel="next",<https://api.github.com/search/code?q=addClass+user%3Amozilla&page=34>;rel="last""
===DONE===