-
Notifications
You must be signed in to change notification settings - Fork 3
/
err12.phpt
73 lines (70 loc) · 1.34 KB
/
err12.phpt
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
66
67
68
69
70
71
72
73
--TEST--
uri_template() invalid expression - error 12 "{?empty=default,var}"
--FILE--
<?php
$data = array(
"id" => "thing",
"var" => "value",
"hello" => "Hello World!",
"empty" => "",
"path" => "/foo/bar",
"x" => "1024",
"y" => "768",
"list" => array("red", "green", "blue"),
"keys" => array(
"semi" => ";",
"dot" => ".",
"comma" => ","
),
"example" => "red",
"searchTerms" => "uri templates"
);
uri_template('{?empty=default,var}', $data, $result);
var_dump($result);
?>
--EXPECT--
array(3) {
["result"]=>
string(20) "{?empty=default,var}"
["state"]=>
int(3)
["expressions"]=>
array(1) {
[0]=>
array(7) {
["op"]=>
string(1) "?"
["sep"]=>
string(1) "&"
["ifemp"]=>
string(1) "="
["allow"]=>
bool(false)
["named"]=>
bool(true)
["error"]=>
bool(true)
["vars"]=>
array(2) {
[0]=>
array(3) {
["name"]=>
string(13) "empty=default"
["length"]=>
int(0)
["explode"]=>
bool(false)
}
[1]=>
array(3) {
["name"]=>
string(3) "var"
["length"]=>
int(0)
["explode"]=>
bool(false)
}
}
}
}
}