| 1 |
lars |
1 |
<?php
|
|
|
2 |
|
|
|
3 |
require_once dirname(dirname(__FILE__)) . '/XML_Feed_Parser_TestCase.php';
|
|
|
4 |
|
|
|
5 |
class date_TestCase extends XML_Feed_Parser_Converted_TestCase {
|
|
|
6 |
|
|
|
7 |
function test_channel_dc_date_1() {
|
|
|
8 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/date/channel_dc_date.xml');
|
|
|
9 |
|
|
|
10 |
$feed = new XML_Feed_Parser($content);
|
|
|
11 |
|
|
|
12 |
$this->assertEquals('2003-12-31T10:14:55Z', $feed->date);
|
|
|
13 |
}
|
|
|
14 |
|
|
|
15 |
function test_channel_dc_date_map_modified_1() {
|
|
|
16 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/date/channel_dc_date_map_modified.xml');
|
|
|
17 |
|
|
|
18 |
$feed = new XML_Feed_Parser($content);
|
|
|
19 |
|
|
|
20 |
$this->assertEquals('2003-12-31T10:14:55Z', $feed->modified);
|
|
|
21 |
}
|
|
|
22 |
|
|
|
23 |
function test_channel_dc_date_w3dtf_utc_1() {
|
|
|
24 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/date/channel_dc_date_w3dtf_utc.xml');
|
|
|
25 |
|
|
|
26 |
$feed = new XML_Feed_Parser($content);
|
|
|
27 |
|
|
|
28 |
$this->assertEquals(array(2003, 12, 31, 10, 14, 55, 2, 365, 0), $feed->date_parsed);
|
|
|
29 |
}
|
|
|
30 |
|
|
|
31 |
function test_channel_dc_date_w3dtf_utc_map_modified_parsed_1() {
|
|
|
32 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/date/channel_dc_date_w3dtf_utc_map_modified_parsed.xml');
|
|
|
33 |
|
|
|
34 |
$feed = new XML_Feed_Parser($content);
|
|
|
35 |
|
|
|
36 |
$this->assertEquals(array(2003, 12, 31, 10, 14, 55, 2, 365, 0), $feed->modified_parsed);
|
|
|
37 |
}
|
|
|
38 |
|
|
|
39 |
function test_channel_dcterms_created_1() {
|
|
|
40 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/date/channel_dcterms_created.xml');
|
|
|
41 |
|
|
|
42 |
$feed = new XML_Feed_Parser($content);
|
|
|
43 |
|
|
|
44 |
$this->assertEquals('2003-12-31T10:14:55Z', $feed->created);
|
|
|
45 |
}
|
|
|
46 |
|
|
|
47 |
function test_channel_dcterms_created_w3dtf_utc_1() {
|
|
|
48 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/date/channel_dcterms_created_w3dtf_utc.xml');
|
|
|
49 |
|
|
|
50 |
$feed = new XML_Feed_Parser($content);
|
|
|
51 |
|
|
|
52 |
$this->assertEquals(array(2003, 12, 31, 10, 14, 55, 2, 365, 0), $feed->created_parsed);
|
|
|
53 |
}
|
|
|
54 |
|
|
|
55 |
function test_channel_dcterms_issued_1() {
|
|
|
56 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/date/channel_dcterms_issued.xml');
|
|
|
57 |
|
|
|
58 |
$feed = new XML_Feed_Parser($content);
|
|
|
59 |
|
|
|
60 |
$this->assertEquals('2003-12-31T10:14:55Z', $feed->issued);
|
|
|
61 |
}
|
|
|
62 |
|
|
|
63 |
function test_channel_dcterms_issued_w3dtf_utc_1() {
|
|
|
64 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/date/channel_dcterms_issued_w3dtf_utc.xml');
|
|
|
65 |
|
|
|
66 |
$feed = new XML_Feed_Parser($content);
|
|
|
67 |
|
|
|
68 |
$this->assertEquals(array(2003, 12, 31, 10, 14, 55, 2, 365, 0), $feed->issued_parsed);
|
|
|
69 |
}
|
|
|
70 |
|
|
|
71 |
function test_channel_dcterms_modified_1() {
|
|
|
72 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/date/channel_dcterms_modified.xml');
|
|
|
73 |
|
|
|
74 |
$feed = new XML_Feed_Parser($content);
|
|
|
75 |
|
|
|
76 |
$this->assertEquals('2003-12-31T10:14:55Z', $feed->modified);
|
|
|
77 |
}
|
|
|
78 |
|
|
|
79 |
function test_channel_dcterms_modified_map_date_1() {
|
|
|
80 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/date/channel_dcterms_modified_map_date.xml');
|
|
|
81 |
|
|
|
82 |
$feed = new XML_Feed_Parser($content);
|
|
|
83 |
|
|
|
84 |
$this->assertEquals('2003-12-31T10:14:55Z', $feed->date);
|
|
|
85 |
}
|
|
|
86 |
|
|
|
87 |
function test_channel_dcterms_modified_w3dtf_utc_1() {
|
|
|
88 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/date/channel_dcterms_modified_w3dtf_utc.xml');
|
|
|
89 |
|
|
|
90 |
$feed = new XML_Feed_Parser($content);
|
|
|
91 |
|
|
|
92 |
$this->assertEquals(array(2003, 12, 31, 10, 14, 55, 2, 365, 0), $feed->modified_parsed);
|
|
|
93 |
}
|
|
|
94 |
|
|
|
95 |
function test_channel_dcterms_modified_w3dtf_utc_map_date_1() {
|
|
|
96 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/date/channel_dcterms_modified_w3dtf_utc_map_date.xml');
|
|
|
97 |
|
|
|
98 |
$feed = new XML_Feed_Parser($content);
|
|
|
99 |
|
|
|
100 |
$this->assertEquals(array(2003, 12, 31, 10, 14, 55, 2, 365, 0), $feed->date_parsed);
|
|
|
101 |
}
|
|
|
102 |
|
|
|
103 |
function test_channel_pubDate_1() {
|
|
|
104 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/date/channel_pubDate.xml');
|
|
|
105 |
|
|
|
106 |
$feed = new XML_Feed_Parser($content);
|
|
|
107 |
|
|
|
108 |
$this->assertEquals('Thu, 01 Jan 2004 19:48:21 GMT', $feed->date);
|
|
|
109 |
}
|
|
|
110 |
|
|
|
111 |
function test_channel_pubDate_asctime_1() {
|
|
|
112 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/date/channel_pubDate_asctime.xml');
|
|
|
113 |
|
|
|
114 |
$feed = new XML_Feed_Parser($content);
|
|
|
115 |
|
|
|
116 |
$this->assertEquals(array(2004, 1, 5, 0, 29, 6, 0, 5, 0), $feed->date_parsed);
|
|
|
117 |
}
|
|
|
118 |
|
|
|
119 |
function test_channel_pubDate_disney_1() {
|
|
|
120 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/date/channel_pubDate_disney.xml');
|
|
|
121 |
|
|
|
122 |
$feed = new XML_Feed_Parser($content);
|
|
|
123 |
|
|
|
124 |
$this->assertEquals(array(2004, 1, 26, 21, 31, 0, 0, 26, 0), $feed->date_parsed);
|
|
|
125 |
}
|
|
|
126 |
|
|
|
127 |
function test_channel_pubDate_disney_at_1() {
|
|
|
128 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/date/channel_pubDate_disney_at.xml');
|
|
|
129 |
|
|
|
130 |
$feed = new XML_Feed_Parser($content);
|
|
|
131 |
|
|
|
132 |
$this->assertEquals(array(2004, 1, 26, 20, 31, 0, 0, 26, 0), $feed->date_parsed);
|
|
|
133 |
}
|
|
|
134 |
|
|
|
135 |
function test_channel_pubDate_disney_ct_1() {
|
|
|
136 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/date/channel_pubDate_disney_ct.xml');
|
|
|
137 |
|
|
|
138 |
$feed = new XML_Feed_Parser($content);
|
|
|
139 |
|
|
|
140 |
$this->assertEquals(array(2004, 1, 26, 22, 31, 0, 0, 26, 0), $feed->date_parsed);
|
|
|
141 |
}
|
|
|
142 |
|
|
|
143 |
function test_channel_pubDate_disney_mt_1() {
|
|
|
144 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/date/channel_pubDate_disney_mt.xml');
|
|
|
145 |
|
|
|
146 |
$feed = new XML_Feed_Parser($content);
|
|
|
147 |
|
|
|
148 |
$this->assertEquals(array(2004, 1, 26, 23, 31, 0, 0, 26, 0), $feed->date_parsed);
|
|
|
149 |
}
|
|
|
150 |
|
|
|
151 |
function test_channel_pubDate_disney_pt_1() {
|
|
|
152 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/date/channel_pubDate_disney_pt.xml');
|
|
|
153 |
|
|
|
154 |
$feed = new XML_Feed_Parser($content);
|
|
|
155 |
|
|
|
156 |
$this->assertEquals(array(2004, 1, 27, 0, 31, 0, 1, 27, 0), $feed->date_parsed);
|
|
|
157 |
}
|
|
|
158 |
|
|
|
159 |
function test_channel_pubDate_greek_1_1() {
|
|
|
160 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/date/channel_pubDate_greek_1.xml');
|
|
|
161 |
|
|
|
162 |
$feed = new XML_Feed_Parser($content);
|
|
|
163 |
|
|
|
164 |
$this->assertEquals(array(2004, 7, 11, 17, 0, 0, 6, 193, 0), $feed->date_parsed);
|
|
|
165 |
}
|
|
|
166 |
|
|
|
167 |
function test_channel_pubDate_hungarian_1_1() {
|
|
|
168 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/date/channel_pubDate_hungarian_1.xml');
|
|
|
169 |
|
|
|
170 |
$feed = new XML_Feed_Parser($content);
|
|
|
171 |
|
|
|
172 |
$this->assertEquals(array(2004, 7, 13, 14, 15, 0, 1, 195, 0), $feed->date_parsed);
|
|
|
173 |
}
|
|
|
174 |
|
|
|
175 |
function test_channel_pubDate_iso8601_ym_1() {
|
|
|
176 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/date/channel_pubDate_iso8601_ym.xml');
|
|
|
177 |
|
|
|
178 |
$feed = new XML_Feed_Parser($content);
|
|
|
179 |
|
|
|
180 |
$this->assertEquals(array(2003, 12, 1, 0, 0, 0, 0, 335, 0), $feed->date_parsed);
|
|
|
181 |
}
|
|
|
182 |
|
|
|
183 |
function test_channel_pubDate_iso8601_ym_2_1() {
|
|
|
184 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/date/channel_pubDate_iso8601_ym_2.xml');
|
|
|
185 |
|
|
|
186 |
$feed = new XML_Feed_Parser($content);
|
|
|
187 |
|
|
|
188 |
$this->assertEquals(array(2003, 12, 1, 0, 0, 0, 0, 335, 0), $feed->date_parsed);
|
|
|
189 |
}
|
|
|
190 |
|
|
|
191 |
function test_channel_pubDate_iso8601_ymd_1() {
|
|
|
192 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/date/channel_pubDate_iso8601_ymd.xml');
|
|
|
193 |
|
|
|
194 |
$feed = new XML_Feed_Parser($content);
|
|
|
195 |
|
|
|
196 |
$this->assertEquals(array(2003, 12, 31, 0, 0, 0, 2, 365, 0), $feed->date_parsed);
|
|
|
197 |
}
|
|
|
198 |
|
|
|
199 |
function test_channel_pubDate_iso8601_ymd_2_1() {
|
|
|
200 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/date/channel_pubDate_iso8601_ymd_2.xml');
|
|
|
201 |
|
|
|
202 |
$feed = new XML_Feed_Parser($content);
|
|
|
203 |
|
|
|
204 |
$this->assertEquals(array(2003, 12, 31, 0, 0, 0, 2, 365, 0), $feed->date_parsed);
|
|
|
205 |
}
|
|
|
206 |
|
|
|
207 |
function test_channel_pubDate_iso8601_yo_2_1() {
|
|
|
208 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/date/channel_pubDate_iso8601_yo_2.xml');
|
|
|
209 |
|
|
|
210 |
$feed = new XML_Feed_Parser($content);
|
|
|
211 |
|
|
|
212 |
$this->assertEquals(array(2003, 12, 1, 0, 0, 0, 0, 335, 0), $feed->date_parsed);
|
|
|
213 |
}
|
|
|
214 |
|
|
|
215 |
function test_channel_pubDate_korean_nate_1() {
|
|
|
216 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/date/channel_pubDate_korean_nate.xml');
|
|
|
217 |
|
|
|
218 |
$feed = new XML_Feed_Parser($content);
|
|
|
219 |
|
|
|
220 |
$this->assertEquals(array(2004, 5, 25, 14, 23, 17, 1, 146, 0), $feed->date_parsed);
|
|
|
221 |
}
|
|
|
222 |
|
|
|
223 |
function test_channel_pubDate_map_modified_1() {
|
|
|
224 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/date/channel_pubDate_map_modified.xml');
|
|
|
225 |
|
|
|
226 |
$feed = new XML_Feed_Parser($content);
|
|
|
227 |
|
|
|
228 |
$this->assertEquals(array(2004, 1, 1, 19, 48, 21, 3, 1, 0), $feed->modified_parsed);
|
|
|
229 |
}
|
|
|
230 |
|
|
|
231 |
function test_channel_pubDate_mssql_1() {
|
|
|
232 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/date/channel_pubDate_mssql.xml');
|
|
|
233 |
|
|
|
234 |
$feed = new XML_Feed_Parser($content);
|
|
|
235 |
|
|
|
236 |
$this->assertEquals(array(2004, 7, 8, 14, 56, 58, 3, 190, 0), $feed->date_parsed);
|
|
|
237 |
}
|
|
|
238 |
|
|
|
239 |
function test_channel_pubDate_mssql_nofraction_1() {
|
|
|
240 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/date/channel_pubDate_mssql_nofraction.xml');
|
|
|
241 |
|
|
|
242 |
$feed = new XML_Feed_Parser($content);
|
|
|
243 |
|
|
|
244 |
$this->assertEquals(array(2004, 7, 8, 14, 56, 58, 3, 190, 0), $feed->date_parsed);
|
|
|
245 |
}
|
|
|
246 |
|
|
|
247 |
function test_channel_pubDate_nosecond_1() {
|
|
|
248 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/date/channel_pubDate_nosecond.xml');
|
|
|
249 |
|
|
|
250 |
$feed = new XML_Feed_Parser($content);
|
|
|
251 |
|
|
|
252 |
$this->assertEquals(array(2004, 1, 1, 0, 0, 0, 3, 1, 0), $feed->date_parsed);
|
|
|
253 |
}
|
|
|
254 |
|
|
|
255 |
function test_channel_pubDate_notime_1() {
|
|
|
256 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/date/channel_pubDate_notime.xml');
|
|
|
257 |
|
|
|
258 |
$feed = new XML_Feed_Parser($content);
|
|
|
259 |
|
|
|
260 |
$this->assertEquals(array(2004, 1, 1, 0, 0, 0, 3, 1, 0), $feed->date_parsed);
|
|
|
261 |
}
|
|
|
262 |
|
|
|
263 |
function test_channel_pubDate_rfc2822_1() {
|
|
|
264 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/date/channel_pubDate_rfc2822.xml');
|
|
|
265 |
|
|
|
266 |
$feed = new XML_Feed_Parser($content);
|
|
|
267 |
|
|
|
268 |
$this->assertEquals(array(2004, 1, 1, 19, 48, 21, 3, 1, 0), $feed->date_parsed);
|
|
|
269 |
}
|
|
|
270 |
|
|
|
271 |
function test_channel_pubDate_rfc2822_rollover_june_31_1() {
|
|
|
272 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/date/channel_pubDate_rfc2822_rollover_june_31.xml');
|
|
|
273 |
|
|
|
274 |
$feed = new XML_Feed_Parser($content);
|
|
|
275 |
|
|
|
276 |
$this->assertEquals(array(2004, 7, 1, 19, 48, 21, 3, 183, 0), $feed->date_parsed);
|
|
|
277 |
}
|
|
|
278 |
|
|
|
279 |
function test_channel_pubDate_rfc822_1() {
|
|
|
280 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/date/channel_pubDate_rfc822.xml');
|
|
|
281 |
|
|
|
282 |
$feed = new XML_Feed_Parser($content);
|
|
|
283 |
|
|
|
284 |
$this->assertEquals(array(2004, 1, 1, 19, 48, 21, 3, 1, 0), $feed->date_parsed);
|
|
|
285 |
}
|
|
|
286 |
|
|
|
287 |
function test_channel_pubDate_w3dtf_rollover_25h_1() {
|
|
|
288 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/date/channel_pubDate_w3dtf_rollover_25h.xml');
|
|
|
289 |
|
|
|
290 |
$feed = new XML_Feed_Parser($content);
|
|
|
291 |
|
|
|
292 |
$this->assertEquals(array(2004, 1, 1, 1, 14, 55, 3, 1, 0), $feed->date_parsed);
|
|
|
293 |
}
|
|
|
294 |
|
|
|
295 |
function test_channel_pubDate_w3dtf_rollover_61m_1() {
|
|
|
296 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/date/channel_pubDate_w3dtf_rollover_61m.xml');
|
|
|
297 |
|
|
|
298 |
$feed = new XML_Feed_Parser($content);
|
|
|
299 |
|
|
|
300 |
$this->assertEquals(array(2003, 12, 31, 11, 1, 55, 2, 365, 0), $feed->date_parsed);
|
|
|
301 |
}
|
|
|
302 |
|
|
|
303 |
function test_channel_pubDate_w3dtf_rollover_61s_1() {
|
|
|
304 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/date/channel_pubDate_w3dtf_rollover_61s.xml');
|
|
|
305 |
|
|
|
306 |
$feed = new XML_Feed_Parser($content);
|
|
|
307 |
|
|
|
308 |
$this->assertEquals(array(2003, 12, 31, 10, 15, 1, 2, 365, 0), $feed->date_parsed);
|
|
|
309 |
}
|
|
|
310 |
|
|
|
311 |
function test_channel_pubDate_w3dtf_rollover_leapyear_1() {
|
|
|
312 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/date/channel_pubDate_w3dtf_rollover_leapyear.xml');
|
|
|
313 |
|
|
|
314 |
$feed = new XML_Feed_Parser($content);
|
|
|
315 |
|
|
|
316 |
$this->assertEquals(array(2004, 2, 29, 2, 14, 55, 6, 60, 0), $feed->date_parsed);
|
|
|
317 |
}
|
|
|
318 |
|
|
|
319 |
function test_channel_pubDate_w3dtf_rollover_leapyear400_1() {
|
|
|
320 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/date/channel_pubDate_w3dtf_rollover_leapyear400.xml');
|
|
|
321 |
|
|
|
322 |
$feed = new XML_Feed_Parser($content);
|
|
|
323 |
|
|
|
324 |
$this->assertEquals(array(2000, 2, 29, 2, 14, 55, 1, 60, 0), $feed->date_parsed);
|
|
|
325 |
}
|
|
|
326 |
|
|
|
327 |
function test_channel_pubDate_w3dtf_rollover_nonleapyear_1() {
|
|
|
328 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/date/channel_pubDate_w3dtf_rollover_nonleapyear.xml');
|
|
|
329 |
|
|
|
330 |
$feed = new XML_Feed_Parser($content);
|
|
|
331 |
|
|
|
332 |
$this->assertEquals(array(2003, 3, 1, 2, 14, 55, 5, 60, 0), $feed->date_parsed);
|
|
|
333 |
}
|
|
|
334 |
|
|
|
335 |
function test_channel_pubDate_w3dtf_sf_1() {
|
|
|
336 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/date/channel_pubDate_w3dtf_sf.xml');
|
|
|
337 |
|
|
|
338 |
$feed = new XML_Feed_Parser($content);
|
|
|
339 |
|
|
|
340 |
$this->assertEquals(array(2003, 12, 31, 18, 14, 55, 2, 365, 0), $feed->date_parsed);
|
|
|
341 |
}
|
|
|
342 |
|
|
|
343 |
function test_channel_pubDate_w3dtf_tokyo_1() {
|
|
|
344 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/date/channel_pubDate_w3dtf_tokyo.xml');
|
|
|
345 |
|
|
|
346 |
$feed = new XML_Feed_Parser($content);
|
|
|
347 |
|
|
|
348 |
$this->assertEquals(array(2003, 12, 31, 10, 14, 55, 2, 365, 0), $feed->date_parsed);
|
|
|
349 |
}
|
|
|
350 |
|
|
|
351 |
function test_channel_pubDate_w3dtf_utc_1() {
|
|
|
352 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/date/channel_pubDate_w3dtf_utc.xml');
|
|
|
353 |
|
|
|
354 |
$feed = new XML_Feed_Parser($content);
|
|
|
355 |
|
|
|
356 |
$this->assertEquals(array(2003, 12, 31, 10, 14, 55, 2, 365, 0), $feed->date_parsed);
|
|
|
357 |
}
|
|
|
358 |
|
|
|
359 |
function test_channel_pubDate_w3dtf_y_1() {
|
|
|
360 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/date/channel_pubDate_w3dtf_y.xml');
|
|
|
361 |
|
|
|
362 |
$feed = new XML_Feed_Parser($content);
|
|
|
363 |
|
|
|
364 |
$this->assertEquals(array(2003, 1, 1, 0, 0, 0, 2, 1, 0), $feed->date_parsed);
|
|
|
365 |
}
|
|
|
366 |
|
|
|
367 |
function test_channel_pubDate_w3dtf_ym_1() {
|
|
|
368 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/date/channel_pubDate_w3dtf_ym.xml');
|
|
|
369 |
|
|
|
370 |
$feed = new XML_Feed_Parser($content);
|
|
|
371 |
|
|
|
372 |
$this->assertEquals(array(2003, 12, 1, 0, 0, 0, 0, 335, 0), $feed->date_parsed);
|
|
|
373 |
}
|
|
|
374 |
|
|
|
375 |
function test_channel_pubDate_w3dtf_ymd_1() {
|
|
|
376 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/date/channel_pubDate_w3dtf_ymd.xml');
|
|
|
377 |
|
|
|
378 |
$feed = new XML_Feed_Parser($content);
|
|
|
379 |
|
|
|
380 |
$this->assertEquals(array(2003, 12, 31, 0, 0, 0, 2, 365, 0), $feed->date_parsed);
|
|
|
381 |
}
|
|
|
382 |
|
|
|
383 |
function test_channel_pubDate_w3dtf_ymd_2_1() {
|
|
|
384 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/date/channel_pubDate_w3dtf_ymd_2.xml');
|
|
|
385 |
|
|
|
386 |
$feed = new XML_Feed_Parser($content);
|
|
|
387 |
|
|
|
388 |
$this->assertEquals(array(2003, 12, 31, 0, 0, 0, 2, 365, 0), $feed->date_parsed);
|
|
|
389 |
}
|
|
|
390 |
|
|
|
391 |
function test_entry_created_1() {
|
|
|
392 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/date/entry_created.xml');
|
|
|
393 |
|
|
|
394 |
$feed = new XML_Feed_Parser($content, false, true);
|
|
|
395 |
|
|
|
396 |
$this->assertEquals('Thu, 01 Jan 2004 19:48:21 GMT', $feed->getEntryByOffset(0)->created);
|
|
|
397 |
}
|
|
|
398 |
|
|
|
399 |
function test_entry_created_w3dtf_utc_1() {
|
|
|
400 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/date/entry_created_w3dtf_utc.xml');
|
|
|
401 |
|
|
|
402 |
$feed = new XML_Feed_Parser($content, false, true);
|
|
|
403 |
|
|
|
404 |
$this->assertEquals(array(2003, 12, 31, 10, 14, 55, 2, 365, 0), $feed->getEntryByOffset(0)->created_parsed);
|
|
|
405 |
}
|
|
|
406 |
|
|
|
407 |
function test_entry_issued_1() {
|
|
|
408 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/date/entry_issued.xml');
|
|
|
409 |
|
|
|
410 |
$feed = new XML_Feed_Parser($content, false, true);
|
|
|
411 |
|
|
|
412 |
$this->assertEquals('Thu, 01 Jan 2004 19:48:21 GMT', $feed->getEntryByOffset(0)->issued);
|
|
|
413 |
}
|
|
|
414 |
|
|
|
415 |
function test_entry_issued_w3dtf_utc_1() {
|
|
|
416 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/date/entry_issued_w3dtf_utc.xml');
|
|
|
417 |
|
|
|
418 |
$feed = new XML_Feed_Parser($content, false, true);
|
|
|
419 |
|
|
|
420 |
$this->assertEquals(array(2003, 12, 31, 10, 14, 55, 2, 365, 0), $feed->getEntryByOffset(0)->issued_parsed);
|
|
|
421 |
}
|
|
|
422 |
|
|
|
423 |
function test_entry_modified_1() {
|
|
|
424 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/date/entry_modified.xml');
|
|
|
425 |
|
|
|
426 |
$feed = new XML_Feed_Parser($content, false, true);
|
|
|
427 |
|
|
|
428 |
$this->assertEquals('Thu, 01 Jan 2004 19:48:21 GMT', $feed->getEntryByOffset(0)->modified);
|
|
|
429 |
}
|
|
|
430 |
|
|
|
431 |
function test_entry_modified_map_date_1() {
|
|
|
432 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/date/entry_modified_map_date.xml');
|
|
|
433 |
|
|
|
434 |
$feed = new XML_Feed_Parser($content, false, true);
|
|
|
435 |
|
|
|
436 |
$this->assertEquals(array(2004, 1, 1, 19, 48, 21, 3, 1, 0), $feed->getEntryByOffset(0)->date_parsed);
|
|
|
437 |
}
|
|
|
438 |
|
|
|
439 |
function test_entry_modified_w3dtf_utc_1() {
|
|
|
440 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/date/entry_modified_w3dtf_utc.xml');
|
|
|
441 |
|
|
|
442 |
$feed = new XML_Feed_Parser($content, false, true);
|
|
|
443 |
|
|
|
444 |
$this->assertEquals(array(2003, 12, 31, 10, 14, 55, 2, 365, 0), $feed->getEntryByOffset(0)->modified_parsed);
|
|
|
445 |
}
|
|
|
446 |
|
|
|
447 |
function test_entry_published_w3dtf_utc_1() {
|
|
|
448 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/date/entry_published_w3dtf_utc.xml');
|
|
|
449 |
|
|
|
450 |
$feed = new XML_Feed_Parser($content);
|
|
|
451 |
|
|
|
452 |
$this->assertEquals(array(2003, 12, 31, 10, 14, 55, 2, 365, 0), $feed->getEntryByOffset(0)->published_parsed);
|
|
|
453 |
}
|
|
|
454 |
|
|
|
455 |
function test_entry_source_updated_w3dtf_utc_1() {
|
|
|
456 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/date/entry_source_updated_w3dtf_utc.xml');
|
|
|
457 |
|
|
|
458 |
$feed = new XML_Feed_Parser($content);
|
|
|
459 |
|
|
|
460 |
$this->assertEquals(array(2003, 12, 31, 10, 14, 55, 2, 365, 0), $feed->getEntryByOffset(0)->source(0, 'updated_parsed'));
|
|
|
461 |
}
|
|
|
462 |
|
|
|
463 |
function test_entry_updated_w3dtf_utc_1() {
|
|
|
464 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/date/entry_updated_w3dtf_utc.xml');
|
|
|
465 |
|
|
|
466 |
$feed = new XML_Feed_Parser($content);
|
|
|
467 |
|
|
|
468 |
$this->assertEquals(array(2003, 12, 31, 10, 14, 55, 2, 365, 0), $feed->getEntryByOffset(0)->updated_parsed);
|
|
|
469 |
}
|
|
|
470 |
|
|
|
471 |
function test_feed_modified_1() {
|
|
|
472 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/date/feed_modified.xml');
|
|
|
473 |
|
|
|
474 |
$feed = new XML_Feed_Parser($content, false, true);
|
|
|
475 |
|
|
|
476 |
$this->assertEquals('Thu, 01 Jan 2004 19:48:21 GMT', $feed->modified);
|
|
|
477 |
}
|
|
|
478 |
|
|
|
479 |
function test_feed_modified_asctime_1() {
|
|
|
480 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/date/feed_modified_asctime.xml');
|
|
|
481 |
|
|
|
482 |
$feed = new XML_Feed_Parser($content, false, true);
|
|
|
483 |
|
|
|
484 |
$this->assertEquals(array(2004, 1, 5, 0, 29, 6, 0, 5, 0), $feed->modified_parsed);
|
|
|
485 |
}
|
|
|
486 |
|
|
|
487 |
function test_feed_modified_disney_1() {
|
|
|
488 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/date/feed_modified_disney.xml');
|
|
|
489 |
|
|
|
490 |
$feed = new XML_Feed_Parser($content, false, true);
|
|
|
491 |
|
|
|
492 |
$this->assertEquals(array(2004, 1, 26, 21, 31, 0, 0, 26, 0), $feed->date_parsed);
|
|
|
493 |
}
|
|
|
494 |
|
|
|
495 |
function test_feed_modified_disney_at_1() {
|
|
|
496 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/date/feed_modified_disney_at.xml');
|
|
|
497 |
|
|
|
498 |
$feed = new XML_Feed_Parser($content, false, true);
|
|
|
499 |
|
|
|
500 |
$this->assertEquals(array(2004, 1, 26, 20, 31, 0, 0, 26, 0), $feed->date_parsed);
|
|
|
501 |
}
|
|
|
502 |
|
|
|
503 |
function test_feed_modified_disney_ct_1() {
|
|
|
504 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/date/feed_modified_disney_ct.xml');
|
|
|
505 |
|
|
|
506 |
$feed = new XML_Feed_Parser($content, false, true);
|
|
|
507 |
|
|
|
508 |
$this->assertEquals(array(2004, 1, 26, 22, 31, 0, 0, 26, 0), $feed->date_parsed);
|
|
|
509 |
}
|
|
|
510 |
|
|
|
511 |
function test_feed_modified_disney_mt_1() {
|
|
|
512 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/date/feed_modified_disney_mt.xml');
|
|
|
513 |
|
|
|
514 |
$feed = new XML_Feed_Parser($content, false, true);
|
|
|
515 |
|
|
|
516 |
$this->assertEquals(array(2004, 1, 26, 23, 31, 0, 0, 26, 0), $feed->date_parsed);
|
|
|
517 |
}
|
|
|
518 |
|
|
|
519 |
function test_feed_modified_disney_pt_1() {
|
|
|
520 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/date/feed_modified_disney_pt.xml');
|
|
|
521 |
|
|
|
522 |
$feed = new XML_Feed_Parser($content, false, true);
|
|
|
523 |
|
|
|
524 |
$this->assertEquals(array(2004, 1, 27, 0, 31, 0, 1, 27, 0), $feed->date_parsed);
|
|
|
525 |
}
|
|
|
526 |
|
|
|
527 |
function test_feed_modified_iso8601_ym_1() {
|
|
|
528 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/date/feed_modified_iso8601_ym.xml');
|
|
|
529 |
|
|
|
530 |
$feed = new XML_Feed_Parser($content, false, true);
|
|
|
531 |
|
|
|
532 |
$this->assertEquals(array(2003, 12, 1, 0, 0, 0, 0, 335, 0), $feed->modified_parsed);
|
|
|
533 |
}
|
|
|
534 |
|
|
|
535 |
function test_feed_modified_iso8601_ym_2_1() {
|
|
|
536 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/date/feed_modified_iso8601_ym_2.xml');
|
|
|
537 |
|
|
|
538 |
$feed = new XML_Feed_Parser($content, false, true);
|
|
|
539 |
|
|
|
540 |
$this->assertEquals(array(2003, 12, 1, 0, 0, 0, 0, 335, 0), $feed->modified_parsed);
|
|
|
541 |
}
|
|
|
542 |
|
|
|
543 |
function test_feed_modified_iso8601_ymd_1() {
|
|
|
544 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/date/feed_modified_iso8601_ymd.xml');
|
|
|
545 |
|
|
|
546 |
$feed = new XML_Feed_Parser($content, false, true);
|
|
|
547 |
|
|
|
548 |
$this->assertEquals(array(2003, 12, 31, 0, 0, 0, 2, 365, 0), $feed->modified_parsed);
|
|
|
549 |
}
|
|
|
550 |
|
|
|
551 |
function test_feed_modified_iso8601_ymd_2_1() {
|
|
|
552 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/date/feed_modified_iso8601_ymd_2.xml');
|
|
|
553 |
|
|
|
554 |
$feed = new XML_Feed_Parser($content, false, true);
|
|
|
555 |
|
|
|
556 |
$this->assertEquals(array(2003, 12, 31, 0, 0, 0, 2, 365, 0), $feed->modified_parsed);
|
|
|
557 |
}
|
|
|
558 |
|
|
|
559 |
function test_feed_modified_iso8601_yo_2_1() {
|
|
|
560 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/date/feed_modified_iso8601_yo_2.xml');
|
|
|
561 |
|
|
|
562 |
$feed = new XML_Feed_Parser($content, false, true);
|
|
|
563 |
|
|
|
564 |
$this->assertEquals(array(2003, 12, 1, 0, 0, 0, 0, 335, 0), $feed->modified_parsed);
|
|
|
565 |
}
|
|
|
566 |
|
|
|
567 |
function test_feed_modified_map_date_1() {
|
|
|
568 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/date/feed_modified_map_date.xml');
|
|
|
569 |
|
|
|
570 |
$feed = new XML_Feed_Parser($content, false, true);
|
|
|
571 |
|
|
|
572 |
$this->assertEquals(array(2004, 1, 1, 19, 48, 21, 3, 1, 0), $feed->date_parsed);
|
|
|
573 |
}
|
|
|
574 |
|
|
|
575 |
function test_feed_modified_rfc2822_1() {
|
|
|
576 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/date/feed_modified_rfc2822.xml');
|
|
|
577 |
|
|
|
578 |
$feed = new XML_Feed_Parser($content, false, true);
|
|
|
579 |
|
|
|
580 |
$this->assertEquals(array(2004, 1, 1, 19, 48, 21, 3, 1, 0), $feed->modified_parsed);
|
|
|
581 |
}
|
|
|
582 |
|
|
|
583 |
function test_feed_modified_rfc2822_rollover_june_31_1() {
|
|
|
584 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/date/feed_modified_rfc2822_rollover_june_31.xml');
|
|
|
585 |
|
|
|
586 |
$feed = new XML_Feed_Parser($content, false, true);
|
|
|
587 |
|
|
|
588 |
$this->assertEquals(array(2004, 7, 1, 19, 48, 21, 3, 183, 0), $feed->modified_parsed);
|
|
|
589 |
}
|
|
|
590 |
|
|
|
591 |
function test_feed_modified_rfc822_1() {
|
|
|
592 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/date/feed_modified_rfc822.xml');
|
|
|
593 |
|
|
|
594 |
$feed = new XML_Feed_Parser($content, false, true);
|
|
|
595 |
|
|
|
596 |
$this->assertEquals(array(2004, 1, 1, 19, 48, 21, 3, 1, 0), $feed->modified_parsed);
|
|
|
597 |
}
|
|
|
598 |
|
|
|
599 |
function test_feed_modified_w3dtf_rollover_leapyear_1() {
|
|
|
600 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/date/feed_modified_w3dtf_rollover_leapyear.xml');
|
|
|
601 |
|
|
|
602 |
$feed = new XML_Feed_Parser($content, false, true);
|
|
|
603 |
|
|
|
604 |
$this->assertEquals(array(2004, 2, 29, 2, 14, 55, 6, 60, 0), $feed->modified_parsed);
|
|
|
605 |
}
|
|
|
606 |
|
|
|
607 |
function test_feed_modified_w3dtf_rollover_leapyear400_1() {
|
|
|
608 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/date/feed_modified_w3dtf_rollover_leapyear400.xml');
|
|
|
609 |
|
|
|
610 |
$feed = new XML_Feed_Parser($content, false, true);
|
|
|
611 |
|
|
|
612 |
$this->assertEquals(array(2000, 2, 29, 2, 14, 55, 1, 60, 0), $feed->modified_parsed);
|
|
|
613 |
}
|
|
|
614 |
|
|
|
615 |
function test_feed_modified_w3dtf_rollover_nonleapyear_1() {
|
|
|
616 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/date/feed_modified_w3dtf_rollover_nonleapyear.xml');
|
|
|
617 |
|
|
|
618 |
$feed = new XML_Feed_Parser($content, false, true);
|
|
|
619 |
|
|
|
620 |
$this->assertEquals(array(2003, 3, 1, 2, 14, 55, 5, 60, 0), $feed->modified_parsed);
|
|
|
621 |
}
|
|
|
622 |
|
|
|
623 |
function test_feed_modified_w3dtf_sf_1() {
|
|
|
624 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/date/feed_modified_w3dtf_sf.xml');
|
|
|
625 |
|
|
|
626 |
$feed = new XML_Feed_Parser($content, false, true);
|
|
|
627 |
|
|
|
628 |
$this->assertEquals(array(2003, 12, 31, 18, 14, 55, 2, 365, 0), $feed->modified_parsed);
|
|
|
629 |
}
|
|
|
630 |
|
|
|
631 |
function test_feed_modified_w3dtf_tokyo_1() {
|
|
|
632 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/date/feed_modified_w3dtf_tokyo.xml');
|
|
|
633 |
|
|
|
634 |
$feed = new XML_Feed_Parser($content, false, true);
|
|
|
635 |
|
|
|
636 |
$this->assertEquals(array(2003, 12, 31, 10, 14, 55, 2, 365, 0), $feed->modified_parsed);
|
|
|
637 |
}
|
|
|
638 |
|
|
|
639 |
function test_feed_modified_w3dtf_utc_1() {
|
|
|
640 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/date/feed_modified_w3dtf_utc.xml');
|
|
|
641 |
|
|
|
642 |
$feed = new XML_Feed_Parser($content, false, true);
|
|
|
643 |
|
|
|
644 |
$this->assertEquals(array(2003, 12, 31, 10, 14, 55, 2, 365, 0), $feed->modified_parsed);
|
|
|
645 |
}
|
|
|
646 |
|
|
|
647 |
function test_feed_modified_w3dtf_y_1() {
|
|
|
648 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/date/feed_modified_w3dtf_y.xml');
|
|
|
649 |
|
|
|
650 |
$feed = new XML_Feed_Parser($content, false, true);
|
|
|
651 |
|
|
|
652 |
$this->assertEquals(array(2003, 1, 1, 0, 0, 0, 2, 1, 0), $feed->modified_parsed);
|
|
|
653 |
}
|
|
|
654 |
|
|
|
655 |
function test_feed_modified_w3dtf_ym_1() {
|
|
|
656 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/date/feed_modified_w3dtf_ym.xml');
|
|
|
657 |
|
|
|
658 |
$feed = new XML_Feed_Parser($content, false, true);
|
|
|
659 |
|
|
|
660 |
$this->assertEquals(array(2003, 12, 1, 0, 0, 0, 0, 335, 0), $feed->modified_parsed);
|
|
|
661 |
}
|
|
|
662 |
|
|
|
663 |
function test_feed_modified_w3dtf_ymd_1() {
|
|
|
664 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/date/feed_modified_w3dtf_ymd.xml');
|
|
|
665 |
|
|
|
666 |
$feed = new XML_Feed_Parser($content, false, true);
|
|
|
667 |
|
|
|
668 |
$this->assertEquals(array(2003, 12, 31, 0, 0, 0, 2, 365, 0), $feed->modified_parsed);
|
|
|
669 |
}
|
|
|
670 |
|
|
|
671 |
function test_feed_modified_w3dtf_ymd_2_1() {
|
|
|
672 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/date/feed_modified_w3dtf_ymd_2.xml');
|
|
|
673 |
|
|
|
674 |
$feed = new XML_Feed_Parser($content, false, true);
|
|
|
675 |
|
|
|
676 |
$this->assertEquals(array(2003, 12, 31, 0, 0, 0, 2, 365, 0), $feed->modified_parsed);
|
|
|
677 |
}
|
|
|
678 |
|
|
|
679 |
function test_feed_updated_w3dtf_utc_1() {
|
|
|
680 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/date/feed_updated_w3dtf_utc.xml');
|
|
|
681 |
|
|
|
682 |
$feed = new XML_Feed_Parser($content);
|
|
|
683 |
|
|
|
684 |
$this->assertEquals(array(2003, 12, 31, 10, 14, 55, 2, 365, 0), $feed->updated_parsed);
|
|
|
685 |
}
|
|
|
686 |
|
|
|
687 |
function test_item_dc_date_1() {
|
|
|
688 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/date/item_dc_date.xml');
|
|
|
689 |
|
|
|
690 |
$feed = new XML_Feed_Parser($content);
|
|
|
691 |
|
|
|
692 |
$this->assertEquals('2003-12-31T10:14:55Z', $feed->getEntryByOffset(0)->date);
|
|
|
693 |
}
|
|
|
694 |
|
|
|
695 |
function test_item_dc_date_map_modified_1() {
|
|
|
696 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/date/item_dc_date_map_modified.xml');
|
|
|
697 |
|
|
|
698 |
$feed = new XML_Feed_Parser($content);
|
|
|
699 |
|
|
|
700 |
$this->assertEquals('2003-12-31T10:14:55Z', $feed->getEntryByOffset(0)->modified);
|
|
|
701 |
}
|
|
|
702 |
|
|
|
703 |
function test_item_dc_date_w3dtf_utc_1() {
|
|
|
704 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/date/item_dc_date_w3dtf_utc.xml');
|
|
|
705 |
|
|
|
706 |
$feed = new XML_Feed_Parser($content);
|
|
|
707 |
|
|
|
708 |
$this->assertEquals(array(2003, 12, 31, 10, 14, 55, 2, 365, 0), $feed->getEntryByOffset(0)->date_parsed);
|
|
|
709 |
}
|
|
|
710 |
|
|
|
711 |
function test_item_dc_date_w3dtf_utc_map_modified_parsed_1() {
|
|
|
712 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/date/item_dc_date_w3dtf_utc_map_modified_parsed.xml');
|
|
|
713 |
|
|
|
714 |
$feed = new XML_Feed_Parser($content);
|
|
|
715 |
|
|
|
716 |
$this->assertEquals(array(2003, 12, 31, 10, 14, 55, 2, 365, 0), $feed->getEntryByOffset(0)->modified_parsed);
|
|
|
717 |
}
|
|
|
718 |
|
|
|
719 |
function test_item_dcterms_created_1() {
|
|
|
720 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/date/item_dcterms_created.xml');
|
|
|
721 |
|
|
|
722 |
$feed = new XML_Feed_Parser($content);
|
|
|
723 |
|
|
|
724 |
$this->assertEquals('2003-12-31T10:14:55Z', $feed->getEntryByOffset(0)->created);
|
|
|
725 |
}
|
|
|
726 |
|
|
|
727 |
function test_item_dcterms_created_w3dtf_utc_1() {
|
|
|
728 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/date/item_dcterms_created_w3dtf_utc.xml');
|
|
|
729 |
|
|
|
730 |
$feed = new XML_Feed_Parser($content);
|
|
|
731 |
|
|
|
732 |
$this->assertEquals(array(2003, 12, 31, 10, 14, 55, 2, 365, 0), $feed->getEntryByOffset(0)->created_parsed);
|
|
|
733 |
}
|
|
|
734 |
|
|
|
735 |
function test_item_dcterms_issued_1() {
|
|
|
736 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/date/item_dcterms_issued.xml');
|
|
|
737 |
|
|
|
738 |
$feed = new XML_Feed_Parser($content);
|
|
|
739 |
|
|
|
740 |
$this->assertEquals('2003-12-31T10:14:55Z', $feed->getEntryByOffset(0)->issued);
|
|
|
741 |
}
|
|
|
742 |
|
|
|
743 |
function test_item_dcterms_issued_w3dtf_utc_1() {
|
|
|
744 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/date/item_dcterms_issued_w3dtf_utc.xml');
|
|
|
745 |
|
|
|
746 |
$feed = new XML_Feed_Parser($content);
|
|
|
747 |
|
|
|
748 |
$this->assertEquals(array(2003, 12, 31, 10, 14, 55, 2, 365, 0), $feed->getEntryByOffset(0)->issued_parsed);
|
|
|
749 |
}
|
|
|
750 |
|
|
|
751 |
function test_item_dcterms_modified_1() {
|
|
|
752 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/date/item_dcterms_modified.xml');
|
|
|
753 |
|
|
|
754 |
$feed = new XML_Feed_Parser($content);
|
|
|
755 |
|
|
|
756 |
$this->assertEquals('2003-12-31T10:14:55Z', $feed->getEntryByOffset(0)->modified);
|
|
|
757 |
}
|
|
|
758 |
|
|
|
759 |
function test_item_dcterms_modified_map_date_1() {
|
|
|
760 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/date/item_dcterms_modified_map_date.xml');
|
|
|
761 |
|
|
|
762 |
$feed = new XML_Feed_Parser($content);
|
|
|
763 |
|
|
|
764 |
$this->assertEquals('2003-12-31T10:14:55Z', $feed->getEntryByOffset(0)->date);
|
|
|
765 |
}
|
|
|
766 |
|
|
|
767 |
function test_item_dcterms_modified_w3dtf_utc_1() {
|
|
|
768 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/date/item_dcterms_modified_w3dtf_utc.xml');
|
|
|
769 |
|
|
|
770 |
$feed = new XML_Feed_Parser($content);
|
|
|
771 |
|
|
|
772 |
$this->assertEquals(array(2003, 12, 31, 10, 14, 55, 2, 365, 0), $feed->getEntryByOffset(0)->modified_parsed);
|
|
|
773 |
}
|
|
|
774 |
|
|
|
775 |
function test_item_dcterms_modified_w3dtf_utc_map_date_1() {
|
|
|
776 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/date/item_dcterms_modified_w3dtf_utc_map_date.xml');
|
|
|
777 |
|
|
|
778 |
$feed = new XML_Feed_Parser($content);
|
|
|
779 |
|
|
|
780 |
$this->assertEquals(array(2003, 12, 31, 10, 14, 55, 2, 365, 0), $feed->getEntryByOffset(0)->date_parsed);
|
|
|
781 |
}
|
|
|
782 |
|
|
|
783 |
function test_item_expirationDate_1() {
|
|
|
784 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/date/item_expirationDate.xml');
|
|
|
785 |
|
|
|
786 |
$feed = new XML_Feed_Parser($content);
|
|
|
787 |
|
|
|
788 |
$this->assertEquals('Thu, 01 Jan 2004 19:48:21 GMT', $feed->getEntryByOffset(0)->expired);
|
|
|
789 |
}
|
|
|
790 |
|
|
|
791 |
function test_item_expirationDate_rfc2822_1() {
|
|
|
792 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/date/item_expirationDate_rfc2822.xml');
|
|
|
793 |
|
|
|
794 |
$feed = new XML_Feed_Parser($content);
|
|
|
795 |
|
|
|
796 |
$this->assertEquals(array(2004, 1, 1, 19, 48, 21, 3, 1, 0), $feed->getEntryByOffset(0)->expired_parsed);
|
|
|
797 |
}
|
|
|
798 |
|
|
|
799 |
function test_item_pubDate_1() {
|
|
|
800 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/date/item_pubDate.xml');
|
|
|
801 |
|
|
|
802 |
$feed = new XML_Feed_Parser($content);
|
|
|
803 |
|
|
|
804 |
$this->assertEquals('Thu, 01 Jan 2004 19:48:21 GMT', $feed->getEntryByOffset(0)->date);
|
|
|
805 |
}
|
|
|
806 |
|
|
|
807 |
function test_item_pubDate_euc_kr_1() {
|
|
|
808 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/date/item_pubDate_euc-kr.xml');
|
|
|
809 |
|
|
|
810 |
$feed = new XML_Feed_Parser($content);
|
|
|
811 |
|
|
|
812 |
$this->assertEquals(array(2004, 5, 27, 16, 31, 15, 3, 148, 0), $feed->getEntryByOffset(0)->modified_parsed);
|
|
|
813 |
}
|
|
|
814 |
|
|
|
815 |
function test_item_pubDate_map_modified_1() {
|
|
|
816 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/date/item_pubDate_map_modified.xml');
|
|
|
817 |
|
|
|
818 |
$feed = new XML_Feed_Parser($content);
|
|
|
819 |
|
|
|
820 |
$this->assertEquals(array(2004, 1, 1, 19, 48, 21, 3, 1, 0), $feed->getEntryByOffset(0)->modified_parsed);
|
|
|
821 |
}
|
|
|
822 |
|
|
|
823 |
function test_item_pubDate_rfc2822_1() {
|
|
|
824 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/date/item_pubDate_rfc2822.xml');
|
|
|
825 |
|
|
|
826 |
$feed = new XML_Feed_Parser($content);
|
|
|
827 |
|
|
|
828 |
$this->assertEquals(array(2004, 1, 1, 19, 48, 21, 3, 1, 0), $feed->getEntryByOffset(0)->date_parsed);
|
|
|
829 |
}
|
|
|
830 |
}
|
|
|
831 |
?>
|