File: params001.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 (65 lines) | stat: -rw-r--r-- 1,054 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
--TEST--
header params
--SKIPIF--
<?php
include "skipif.inc";
?>
--FILE--
<?php
echo "Test\n";

$ct = new http\Params("text/html; charset=utf-8", ",", ";", "=", 0);

var_dump(
	isset($ct["text/html"]),
	isset($ct["text/json"]),
	$ct["text/html"]["arguments"]["charset"]
);

unset($ct["text/html"]);
$ct[] = "text/json";
$ct["text/json"] = array("arguments" => array("charset" => "iso-8859-1"));

var_dump(
	isset($ct["text/html"]),
	isset($ct["text/json"]),
	$ct["text/json"]["arguments"]["charset"]
);

var_dump((string) $ct,$ct);

?>
DONE
--EXPECTF--
Test
bool(true)
bool(false)
string(5) "utf-8"
bool(false)
bool(true)
string(10) "iso-8859-1"
string(%d) "text/json;charset=iso-8859-1"
object(http\Params)#%d (5) {
  ["params"]=>
  array(1) {
    ["text/json"]=>
    array(2) {
      ["value"]=>
      bool(true)
      ["arguments"]=>
      array(1) {
        ["charset"]=>
        string(10) "iso-8859-1"
      }
    }
  }
  ["param_sep"]=>
  string(1) ","
  ["arg_sep"]=>
  string(1) ";"
  ["val_sep"]=>
  string(1) "="
  ["flags"]=>
  int(0)
}
DONE