add CURLINFO_RETRY_AFTER
[m6w6/ext-http] / tests / urlparser002.phpt
1 --TEST--
2 url parser with paths
3 --SKIPIF--
4 <?php
5 include "skipif.inc";
6 ?>
7 --FILE--
8 <?php
9 echo "Test\n";
10
11 $urls = array(
12 "s:a/",
13 "ss:aa/",
14 "s:/a/",
15 "ss:/aa/",
16 "s://a/",
17 "s://h/a",
18 "ss://hh/aa",
19 "s:///a/b",
20 "ss:///aa/bb",
21 );
22
23 foreach ($urls as $url) {
24 printf("\n%s\n", $url);
25 var_dump(new http\Url($url, null, 0));
26 }
27 ?>
28 DONE
29 --EXPECTF--
30 Test
31
32 s:a/
33 object(http\Url)#%d (8) {
34 ["scheme"]=>
35 string(1) "s"
36 ["user"]=>
37 NULL
38 ["pass"]=>
39 NULL
40 ["host"]=>
41 NULL
42 ["port"]=>
43 NULL
44 ["path"]=>
45 string(2) "a/"
46 ["query"]=>
47 NULL
48 ["fragment"]=>
49 NULL
50 }
51
52 ss:aa/
53 object(http\Url)#%d (8) {
54 ["scheme"]=>
55 string(2) "ss"
56 ["user"]=>
57 NULL
58 ["pass"]=>
59 NULL
60 ["host"]=>
61 NULL
62 ["port"]=>
63 NULL
64 ["path"]=>
65 string(3) "aa/"
66 ["query"]=>
67 NULL
68 ["fragment"]=>
69 NULL
70 }
71
72 s:/a/
73 object(http\Url)#%d (8) {
74 ["scheme"]=>
75 string(1) "s"
76 ["user"]=>
77 NULL
78 ["pass"]=>
79 NULL
80 ["host"]=>
81 NULL
82 ["port"]=>
83 NULL
84 ["path"]=>
85 string(3) "/a/"
86 ["query"]=>
87 NULL
88 ["fragment"]=>
89 NULL
90 }
91
92 ss:/aa/
93 object(http\Url)#%d (8) {
94 ["scheme"]=>
95 string(2) "ss"
96 ["user"]=>
97 NULL
98 ["pass"]=>
99 NULL
100 ["host"]=>
101 NULL
102 ["port"]=>
103 NULL
104 ["path"]=>
105 string(4) "/aa/"
106 ["query"]=>
107 NULL
108 ["fragment"]=>
109 NULL
110 }
111
112 s://a/
113 object(http\Url)#%d (8) {
114 ["scheme"]=>
115 string(1) "s"
116 ["user"]=>
117 NULL
118 ["pass"]=>
119 NULL
120 ["host"]=>
121 string(1) "a"
122 ["port"]=>
123 NULL
124 ["path"]=>
125 string(1) "/"
126 ["query"]=>
127 NULL
128 ["fragment"]=>
129 NULL
130 }
131
132 s://h/a
133 object(http\Url)#%d (8) {
134 ["scheme"]=>
135 string(1) "s"
136 ["user"]=>
137 NULL
138 ["pass"]=>
139 NULL
140 ["host"]=>
141 string(1) "h"
142 ["port"]=>
143 NULL
144 ["path"]=>
145 string(2) "/a"
146 ["query"]=>
147 NULL
148 ["fragment"]=>
149 NULL
150 }
151
152 ss://hh/aa
153 object(http\Url)#%d (8) {
154 ["scheme"]=>
155 string(2) "ss"
156 ["user"]=>
157 NULL
158 ["pass"]=>
159 NULL
160 ["host"]=>
161 string(2) "hh"
162 ["port"]=>
163 NULL
164 ["path"]=>
165 string(3) "/aa"
166 ["query"]=>
167 NULL
168 ["fragment"]=>
169 NULL
170 }
171
172 s:///a/b
173 object(http\Url)#%d (8) {
174 ["scheme"]=>
175 string(1) "s"
176 ["user"]=>
177 NULL
178 ["pass"]=>
179 NULL
180 ["host"]=>
181 NULL
182 ["port"]=>
183 NULL
184 ["path"]=>
185 string(4) "/a/b"
186 ["query"]=>
187 NULL
188 ["fragment"]=>
189 NULL
190 }
191
192 ss:///aa/bb
193 object(http\Url)#%d (8) {
194 ["scheme"]=>
195 string(2) "ss"
196 ["user"]=>
197 NULL
198 ["pass"]=>
199 NULL
200 ["host"]=>
201 NULL
202 ["port"]=>
203 NULL
204 ["path"]=>
205 string(6) "/aa/bb"
206 ["query"]=>
207 NULL
208 ["fragment"]=>
209 NULL
210 }
211 DONE