Skip to content

Commit 2e08e23

Browse files
remicolletbd808
authored andcommitted
add test for #65
1 parent 5fadb29 commit 2e08e23

File tree

2 files changed

+90
-0
lines changed

2 files changed

+90
-0
lines changed

package.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@
106106
<file role="test" name="yaml_parse_spec_set.phpt" />
107107
<file role="test" name="yaml_parse_spec_str.phpt" />
108108
<file role="test" name="yaml_parse_spec_timestamp.phpt" />
109+
<file role="test" name="yaml_parse_url_001.phpt" />
109110
<file role="test" name="yaml_parse_wiki_YtsBasicTests_001.phpt" />
110111
<file role="test" name="yaml_parse_wiki_YtsBasicTests_002.phpt" />
111112
<file role="test" name="yaml_parse_wiki_YtsBasicTests_003.phpt" />

tests/yaml_parse_url_001.phpt

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
--TEST--
2+
yaml_parse_url - general
3+
--SKIPIF--
4+
<?php if(!extension_loaded('yaml')) die('skip yaml n/a'); ?>
5+
--INI--
6+
yaml.decode_timestamp=1
7+
date.timezone=GMT
8+
--FILE--
9+
<?php
10+
var_dump(yaml_parse_url('file://' . __DIR__ . '/yaml_parse_file_001.yaml'));
11+
?>
12+
--EXPECT--
13+
array(8) {
14+
["invoice"]=>
15+
int(34843)
16+
["date"]=>
17+
int(980208000)
18+
["bill-to"]=>
19+
&array(3) {
20+
["given"]=>
21+
string(5) "Chris"
22+
["family"]=>
23+
string(6) "Dumars"
24+
["address"]=>
25+
array(4) {
26+
["lines"]=>
27+
string(27) "458 Walkman Dr.
28+
Suite #292
29+
"
30+
["city"]=>
31+
string(9) "Royal Oak"
32+
["state"]=>
33+
string(2) "MI"
34+
["postal"]=>
35+
int(48046)
36+
}
37+
}
38+
["ship-to"]=>
39+
&array(3) {
40+
["given"]=>
41+
string(5) "Chris"
42+
["family"]=>
43+
string(6) "Dumars"
44+
["address"]=>
45+
array(4) {
46+
["lines"]=>
47+
string(27) "458 Walkman Dr.
48+
Suite #292
49+
"
50+
["city"]=>
51+
string(9) "Royal Oak"
52+
["state"]=>
53+
string(2) "MI"
54+
["postal"]=>
55+
int(48046)
56+
}
57+
}
58+
["product"]=>
59+
array(2) {
60+
[0]=>
61+
array(4) {
62+
["sku"]=>
63+
string(6) "BL394D"
64+
["quantity"]=>
65+
int(4)
66+
["description"]=>
67+
string(10) "Basketball"
68+
["price"]=>
69+
float(450)
70+
}
71+
[1]=>
72+
array(4) {
73+
["sku"]=>
74+
string(7) "BL4438H"
75+
["quantity"]=>
76+
int(1)
77+
["description"]=>
78+
string(10) "Super Hoop"
79+
["price"]=>
80+
float(2392)
81+
}
82+
}
83+
["tax"]=>
84+
float(251.42)
85+
["total"]=>
86+
float(4443.52)
87+
["comments"]=>
88+
string(68) "Late afternoon is best. Backup contact is Nancy Billsmer @ 338-4338."
89+
}

0 commit comments

Comments
 (0)