1 | <?php |
---|
2 | |
---|
3 | require_once 'XML_Feed_Parser_TestCase.php'; |
---|
4 | |
---|
5 | class atom10_TestCase extends XML_Feed_Parser_Converted_TestCase { |
---|
6 | |
---|
7 | function test_atom10_namespace_1 () { |
---|
8 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/atom10_namespace.xml'); |
---|
9 | try { |
---|
10 | $feed = new XML_Feed_Parser($content); |
---|
11 | } catch (XML_Feed_Parser_Exception $e) { |
---|
12 | $this->assertTrue(false); |
---|
13 | return; |
---|
14 | } |
---|
15 | $this->assertEquals('Example Atom', $feed->title); |
---|
16 | } |
---|
17 | |
---|
18 | function test_atom10_version_1 () { |
---|
19 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/atom10_version.xml'); |
---|
20 | try { |
---|
21 | $feed = new XML_Feed_Parser($content); |
---|
22 | } catch (XML_Feed_Parser_Exception $e) { |
---|
23 | $this->assertTrue(false); |
---|
24 | return; |
---|
25 | } |
---|
26 | $this->assertEquals('atom10', $feed->version()); |
---|
27 | } |
---|
28 | |
---|
29 | function test_entry_author_email_1 () { |
---|
30 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_author_email.xml'); |
---|
31 | try { |
---|
32 | $feed = new XML_Feed_Parser($content); |
---|
33 | } catch (XML_Feed_Parser_Exception $e) { |
---|
34 | $this->assertTrue(false); |
---|
35 | return; |
---|
36 | } |
---|
37 | $this->assertEquals('me@example.com', $feed->getEntryByOffset(0)->author(0, 'email')); |
---|
38 | } |
---|
39 | |
---|
40 | function test_entry_author_map_author_1 () { |
---|
41 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_author_map_author.xml'); |
---|
42 | try { |
---|
43 | $feed = new XML_Feed_Parser($content); |
---|
44 | } catch (XML_Feed_Parser_Exception $e) { |
---|
45 | $this->assertTrue(false); |
---|
46 | return; |
---|
47 | } |
---|
48 | $this->assertEquals('Example author (me@example.com)', $feed->getEntryByOffset(0)->author); |
---|
49 | } |
---|
50 | |
---|
51 | function test_entry_author_map_author_2_1 () { |
---|
52 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_author_map_author_2.xml'); |
---|
53 | try { |
---|
54 | $feed = new XML_Feed_Parser($content); |
---|
55 | } catch (XML_Feed_Parser_Exception $e) { |
---|
56 | $this->assertTrue(false); |
---|
57 | return; |
---|
58 | } |
---|
59 | $this->assertEquals('Example author', $feed->getEntryByOffset(0)->author); |
---|
60 | } |
---|
61 | |
---|
62 | function test_entry_author_name_1 () { |
---|
63 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_author_name.xml'); |
---|
64 | try { |
---|
65 | $feed = new XML_Feed_Parser($content); |
---|
66 | } catch (XML_Feed_Parser_Exception $e) { |
---|
67 | $this->assertTrue(false); |
---|
68 | return; |
---|
69 | } |
---|
70 | $this->assertEquals('Example author', $feed->getEntryByOffset(0)->author(0, 'name')); |
---|
71 | } |
---|
72 | |
---|
73 | function test_entry_author_uri_1 () { |
---|
74 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_author_uri.xml'); |
---|
75 | try { |
---|
76 | $feed = new XML_Feed_Parser($content); |
---|
77 | } catch (XML_Feed_Parser_Exception $e) { |
---|
78 | $this->assertTrue(false); |
---|
79 | return; |
---|
80 | } |
---|
81 | $this->assertEquals('http://example.com/', $feed->getEntryByOffset(0)->author(0, 'url')); |
---|
82 | } |
---|
83 | |
---|
84 | function test_entry_author_url_1 () { |
---|
85 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_author_url.xml'); |
---|
86 | try { |
---|
87 | $feed = new XML_Feed_Parser($content); |
---|
88 | } catch (XML_Feed_Parser_Exception $e) { |
---|
89 | $this->assertTrue(false); |
---|
90 | return; |
---|
91 | } |
---|
92 | $this->assertEquals('http://example.com/', $feed->getEntryByOffset(0)->author(0, 'url')); |
---|
93 | } |
---|
94 | |
---|
95 | function test_entry_category_label_1 () { |
---|
96 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_category_label.xml'); |
---|
97 | try { |
---|
98 | $feed = new XML_Feed_Parser($content); |
---|
99 | } catch (XML_Feed_Parser_Exception $e) { |
---|
100 | $this->assertTrue(false); |
---|
101 | return; |
---|
102 | } |
---|
103 | $this->assertEquals('Atom 1.0 tests', $feed->getEntryByOffset(0)->tags(0, 'label')); |
---|
104 | } |
---|
105 | |
---|
106 | function test_entry_category_scheme_1 () { |
---|
107 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_category_scheme.xml'); |
---|
108 | try { |
---|
109 | $feed = new XML_Feed_Parser($content); |
---|
110 | } catch (XML_Feed_Parser_Exception $e) { |
---|
111 | $this->assertTrue(false); |
---|
112 | return; |
---|
113 | } |
---|
114 | $this->assertEquals('http://feedparser.org/tests/', $feed->getEntryByOffset(0)->tags(0, 'scheme')); |
---|
115 | } |
---|
116 | |
---|
117 | function test_entry_category_term_1 () { |
---|
118 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_category_term.xml'); |
---|
119 | try { |
---|
120 | $feed = new XML_Feed_Parser($content); |
---|
121 | } catch (XML_Feed_Parser_Exception $e) { |
---|
122 | $this->assertTrue(false); |
---|
123 | return; |
---|
124 | } |
---|
125 | $this->assertEquals('atom10', $feed->getEntryByOffset(0)->tags(0, 'term')); |
---|
126 | } |
---|
127 | |
---|
128 | function test_entry_content_application_xml_1 () { |
---|
129 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_content_application_xml.xml'); |
---|
130 | try { |
---|
131 | $feed = new XML_Feed_Parser($content); |
---|
132 | } catch (XML_Feed_Parser_Exception $e) { |
---|
133 | $this->assertTrue(false); |
---|
134 | return; |
---|
135 | } |
---|
136 | $this->assertEquals('<div>Example <b>Atom</b></div>', $feed->getEntryByOffset(0)->content(0, 'value')); |
---|
137 | } |
---|
138 | |
---|
139 | function test_entry_content_base64_1 () { |
---|
140 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_content_base64.xml'); |
---|
141 | try { |
---|
142 | $feed = new XML_Feed_Parser($content); |
---|
143 | } catch (XML_Feed_Parser_Exception $e) { |
---|
144 | $this->assertTrue(false); |
---|
145 | return; |
---|
146 | } |
---|
147 | $this->assertEquals('Example <b>Atom</b>', $feed->getEntryByOffset(0)->content(0, 'value')); |
---|
148 | } |
---|
149 | |
---|
150 | function test_entry_content_base64_2_1 () { |
---|
151 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_content_base64_2.xml'); |
---|
152 | try { |
---|
153 | $feed = new XML_Feed_Parser($content); |
---|
154 | } catch (XML_Feed_Parser_Exception $e) { |
---|
155 | $this->assertTrue(false); |
---|
156 | return; |
---|
157 | } |
---|
158 | $this->assertEquals('<p>History of the <blink> tag</p>', $feed->getEntryByOffset(0)->content(0, 'value')); |
---|
159 | } |
---|
160 | |
---|
161 | function test_entry_content_escaped_markup_1 () { |
---|
162 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_content_escaped_markup.xml'); |
---|
163 | try { |
---|
164 | $feed = new XML_Feed_Parser($content); |
---|
165 | } catch (XML_Feed_Parser_Exception $e) { |
---|
166 | $this->assertTrue(false); |
---|
167 | return; |
---|
168 | } |
---|
169 | $this->assertEquals('Example <b>Atom</b>', $feed->getEntryByOffset(0)->content(0, 'value')); |
---|
170 | } |
---|
171 | |
---|
172 | function test_entry_content_inline_markup_1 () { |
---|
173 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_content_inline_markup.xml'); |
---|
174 | try { |
---|
175 | $feed = new XML_Feed_Parser($content); |
---|
176 | } catch (XML_Feed_Parser_Exception $e) { |
---|
177 | $this->assertTrue(false); |
---|
178 | return; |
---|
179 | } |
---|
180 | $this->assertEquals('<div>Example <b>Atom</b></div>', $feed->getEntryByOffset(0)->content(0, 'value')); |
---|
181 | } |
---|
182 | |
---|
183 | function test_entry_content_inline_markup_2_1 () { |
---|
184 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_content_inline_markup_2.xml'); |
---|
185 | try { |
---|
186 | $feed = new XML_Feed_Parser($content); |
---|
187 | } catch (XML_Feed_Parser_Exception $e) { |
---|
188 | $this->assertTrue(false); |
---|
189 | return; |
---|
190 | } |
---|
191 | $this->assertEquals('<div>History of the <blink> tag</div>', $feed->getEntryByOffset(0)->content(0, 'value')); |
---|
192 | } |
---|
193 | |
---|
194 | function test_entry_content_src_1 () { |
---|
195 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_content_src.xml'); |
---|
196 | try { |
---|
197 | $feed = new XML_Feed_Parser($content); |
---|
198 | } catch (XML_Feed_Parser_Exception $e) { |
---|
199 | $this->assertTrue(false); |
---|
200 | return; |
---|
201 | } |
---|
202 | $this->assertEquals('http://example.com/movie.mp4', $feed->getEntryByOffset(0)->content(0, 'src')); |
---|
203 | } |
---|
204 | |
---|
205 | function test_entry_content_text_plain_1 () { |
---|
206 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_content_text_plain.xml'); |
---|
207 | try { |
---|
208 | $feed = new XML_Feed_Parser($content); |
---|
209 | } catch (XML_Feed_Parser_Exception $e) { |
---|
210 | $this->assertTrue(false); |
---|
211 | return; |
---|
212 | } |
---|
213 | $this->assertEquals('Example Atom', $feed->getEntryByOffset(0)->content(0, 'value')); |
---|
214 | } |
---|
215 | |
---|
216 | function test_entry_content_text_plain_brackets_1 () { |
---|
217 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_content_text_plain_brackets.xml'); |
---|
218 | try { |
---|
219 | $feed = new XML_Feed_Parser($content); |
---|
220 | } catch (XML_Feed_Parser_Exception $e) { |
---|
221 | $this->assertTrue(false); |
---|
222 | return; |
---|
223 | } |
---|
224 | $this->assertEquals('History of the <blink> tag', $feed->getEntryByOffset(0)->content(0, 'value')); |
---|
225 | } |
---|
226 | |
---|
227 | function test_entry_content_type_1 () { |
---|
228 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_content_type.xml'); |
---|
229 | try { |
---|
230 | $feed = new XML_Feed_Parser($content); |
---|
231 | } catch (XML_Feed_Parser_Exception $e) { |
---|
232 | $this->assertTrue(false); |
---|
233 | return; |
---|
234 | } |
---|
235 | $this->assertEquals('text/plain', $feed->getEntryByOffset(0)->content(0, 'type')); |
---|
236 | } |
---|
237 | |
---|
238 | function test_entry_content_type_text_1 () { |
---|
239 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_content_type_text.xml'); |
---|
240 | try { |
---|
241 | $feed = new XML_Feed_Parser($content); |
---|
242 | } catch (XML_Feed_Parser_Exception $e) { |
---|
243 | $this->assertTrue(false); |
---|
244 | return; |
---|
245 | } |
---|
246 | $this->assertEquals('text/plain', $feed->getEntryByOffset(0)->content(0, 'type')); |
---|
247 | } |
---|
248 | |
---|
249 | function test_entry_content_value_1 () { |
---|
250 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_content_value.xml'); |
---|
251 | try { |
---|
252 | $feed = new XML_Feed_Parser($content); |
---|
253 | } catch (XML_Feed_Parser_Exception $e) { |
---|
254 | $this->assertTrue(false); |
---|
255 | return; |
---|
256 | } |
---|
257 | $this->assertEquals('Example Atom', $feed->getEntryByOffset(0)->content(0, 'value')); |
---|
258 | } |
---|
259 | |
---|
260 | function test_entry_contributor_email_1 () { |
---|
261 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_contributor_email.xml'); |
---|
262 | try { |
---|
263 | $feed = new XML_Feed_Parser($content); |
---|
264 | } catch (XML_Feed_Parser_Exception $e) { |
---|
265 | $this->assertTrue(false); |
---|
266 | return; |
---|
267 | } |
---|
268 | $this->assertEquals('me@example.com', $feed->getEntryByOffset(0)->contributors(0, 'email')); |
---|
269 | } |
---|
270 | |
---|
271 | function test_entry_contributor_multiple_1 () { |
---|
272 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_contributor_multiple.xml'); |
---|
273 | try { |
---|
274 | $feed = new XML_Feed_Parser($content); |
---|
275 | } catch (XML_Feed_Parser_Exception $e) { |
---|
276 | $this->assertTrue(false); |
---|
277 | return; |
---|
278 | } |
---|
279 | $this->assertEquals(array(array('name' => 'Contributor 1', 'email' => 'me@example.com', 'href' => 'http://example.com/'), array('name' => 'Contributor 2', 'email' => 'you@example.com', 'href' => 'http://two.example.com/')), $feed->getEntryByOffset(0)->contributors); |
---|
280 | } |
---|
281 | |
---|
282 | function test_entry_contributor_name_1 () { |
---|
283 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_contributor_name.xml'); |
---|
284 | try { |
---|
285 | $feed = new XML_Feed_Parser($content); |
---|
286 | } catch (XML_Feed_Parser_Exception $e) { |
---|
287 | $this->assertTrue(false); |
---|
288 | return; |
---|
289 | } |
---|
290 | $this->assertEquals('Example contributor', $feed->getEntryByOffset(0)->contributors(0, 'name')); |
---|
291 | } |
---|
292 | |
---|
293 | function test_entry_contributor_uri_1 () { |
---|
294 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_contributor_uri.xml'); |
---|
295 | try { |
---|
296 | $feed = new XML_Feed_Parser($content); |
---|
297 | } catch (XML_Feed_Parser_Exception $e) { |
---|
298 | $this->assertTrue(false); |
---|
299 | return; |
---|
300 | } |
---|
301 | $this->assertEquals('http://example.com/', $feed->getEntryByOffset(0)->contributors(0, 'url')); |
---|
302 | } |
---|
303 | |
---|
304 | function test_entry_contributor_url_1 () { |
---|
305 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_contributor_url.xml'); |
---|
306 | try { |
---|
307 | $feed = new XML_Feed_Parser($content); |
---|
308 | } catch (XML_Feed_Parser_Exception $e) { |
---|
309 | $this->assertTrue(false); |
---|
310 | return; |
---|
311 | } |
---|
312 | $this->assertEquals('http://example.com/', $feed->getEntryByOffset(0)->contributors(0, 'url')); |
---|
313 | } |
---|
314 | |
---|
315 | function test_entry_id_1 () { |
---|
316 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_id.xml'); |
---|
317 | try { |
---|
318 | $feed = new XML_Feed_Parser($content); |
---|
319 | } catch (XML_Feed_Parser_Exception $e) { |
---|
320 | $this->assertTrue(false); |
---|
321 | return; |
---|
322 | } |
---|
323 | $this->assertEquals('http://example.com/', $feed->getEntryByOffset(0)->id); |
---|
324 | } |
---|
325 | |
---|
326 | function test_entry_id_map_guid_1 () { |
---|
327 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_id_map_guid.xml'); |
---|
328 | try { |
---|
329 | $feed = new XML_Feed_Parser($content); |
---|
330 | } catch (XML_Feed_Parser_Exception $e) { |
---|
331 | $this->assertTrue(false); |
---|
332 | return; |
---|
333 | } |
---|
334 | $this->assertEquals('http://example.com/', $feed->getEntryByOffset(0)->guid); |
---|
335 | } |
---|
336 | |
---|
337 | function test_entry_id_no_normalization_1_1 () { |
---|
338 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_id_no_normalization_1.xml'); |
---|
339 | try { |
---|
340 | $feed = new XML_Feed_Parser($content); |
---|
341 | } catch (XML_Feed_Parser_Exception $e) { |
---|
342 | $this->assertTrue(false); |
---|
343 | return; |
---|
344 | } |
---|
345 | $this->assertEquals('http://www.example.org/thing', $feed->getEntryByOffset(0)->id); |
---|
346 | } |
---|
347 | |
---|
348 | function test_entry_id_no_normalization_2_1 () { |
---|
349 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_id_no_normalization_2.xml'); |
---|
350 | try { |
---|
351 | $feed = new XML_Feed_Parser($content); |
---|
352 | } catch (XML_Feed_Parser_Exception $e) { |
---|
353 | $this->assertTrue(false); |
---|
354 | return; |
---|
355 | } |
---|
356 | $this->assertEquals('http://www.example.org/Thing', $feed->getEntryByOffset(0)->id); |
---|
357 | } |
---|
358 | |
---|
359 | function test_entry_id_no_normalization_3_1 () { |
---|
360 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_id_no_normalization_3.xml'); |
---|
361 | try { |
---|
362 | $feed = new XML_Feed_Parser($content); |
---|
363 | } catch (XML_Feed_Parser_Exception $e) { |
---|
364 | $this->assertTrue(false); |
---|
365 | return; |
---|
366 | } |
---|
367 | $this->assertEquals('http://www.EXAMPLE.org/thing', $feed->getEntryByOffset(0)->id); |
---|
368 | } |
---|
369 | |
---|
370 | function test_entry_id_no_normalization_4_1 () { |
---|
371 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_id_no_normalization_4.xml'); |
---|
372 | try { |
---|
373 | $feed = new XML_Feed_Parser($content); |
---|
374 | } catch (XML_Feed_Parser_Exception $e) { |
---|
375 | $this->assertTrue(false); |
---|
376 | return; |
---|
377 | } |
---|
378 | $this->assertEquals('HTTP://www.example.org/thing', $feed->getEntryByOffset(0)->id); |
---|
379 | } |
---|
380 | |
---|
381 | function test_entry_id_no_normalization_5_1 () { |
---|
382 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_id_no_normalization_5.xml'); |
---|
383 | try { |
---|
384 | $feed = new XML_Feed_Parser($content); |
---|
385 | } catch (XML_Feed_Parser_Exception $e) { |
---|
386 | $this->assertTrue(false); |
---|
387 | return; |
---|
388 | } |
---|
389 | $this->assertEquals('http://www.example.com/~bob', $feed->getEntryByOffset(0)->id); |
---|
390 | } |
---|
391 | |
---|
392 | function test_entry_id_no_normalization_6_1 () { |
---|
393 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_id_no_normalization_6.xml'); |
---|
394 | try { |
---|
395 | $feed = new XML_Feed_Parser($content); |
---|
396 | } catch (XML_Feed_Parser_Exception $e) { |
---|
397 | $this->assertTrue(false); |
---|
398 | return; |
---|
399 | } |
---|
400 | $this->assertEquals('http://www.example.com/%7ebob', $feed->getEntryByOffset(0)->id); |
---|
401 | } |
---|
402 | |
---|
403 | function test_entry_id_no_normalization_7_1 () { |
---|
404 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_id_no_normalization_7.xml'); |
---|
405 | try { |
---|
406 | $feed = new XML_Feed_Parser($content); |
---|
407 | } catch (XML_Feed_Parser_Exception $e) { |
---|
408 | $this->assertTrue(false); |
---|
409 | return; |
---|
410 | } |
---|
411 | $this->assertEquals('http://www.example.com/%7Ebob', $feed->getEntryByOffset(0)->id); |
---|
412 | } |
---|
413 | |
---|
414 | function test_entry_link_alternate_map_link_1 () { |
---|
415 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_link_alternate_map_link.xml'); |
---|
416 | try { |
---|
417 | $feed = new XML_Feed_Parser($content); |
---|
418 | } catch (XML_Feed_Parser_Exception $e) { |
---|
419 | $this->assertTrue(false); |
---|
420 | return; |
---|
421 | } |
---|
422 | $this->assertEquals('http://www.example.com/', $feed->getEntryByOffset(0)->link); |
---|
423 | } |
---|
424 | |
---|
425 | function test_entry_link_alternate_map_link_2_1 () { |
---|
426 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_link_alternate_map_link_2.xml'); |
---|
427 | try { |
---|
428 | $feed = new XML_Feed_Parser($content); |
---|
429 | } catch (XML_Feed_Parser_Exception $e) { |
---|
430 | $this->assertTrue(false); |
---|
431 | return; |
---|
432 | } |
---|
433 | $this->assertEquals('http://www.example.com/', $feed->getEntryByOffset(0)->link); |
---|
434 | } |
---|
435 | |
---|
436 | function test_entry_link_alternate_map_link_3_1 () { |
---|
437 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_link_alternate_map_link_3.xml'); |
---|
438 | try { |
---|
439 | $feed = new XML_Feed_Parser($content); |
---|
440 | } catch (XML_Feed_Parser_Exception $e) { |
---|
441 | $this->assertTrue(false); |
---|
442 | return; |
---|
443 | } |
---|
444 | $this->assertEquals('http://www.example.com/alternate', $feed->getEntryByOffset(0)->link); |
---|
445 | } |
---|
446 | |
---|
447 | function test_entry_link_href_1 () { |
---|
448 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_link_href.xml'); |
---|
449 | try { |
---|
450 | $feed = new XML_Feed_Parser($content); |
---|
451 | } catch (XML_Feed_Parser_Exception $e) { |
---|
452 | $this->assertTrue(false); |
---|
453 | return; |
---|
454 | } |
---|
455 | $this->assertEquals('http://www.example.com/', $feed->getEntryByOffset(0)->links(0, 'href')); |
---|
456 | } |
---|
457 | |
---|
458 | function test_entry_link_hreflang_1 () { |
---|
459 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_link_hreflang.xml'); |
---|
460 | try { |
---|
461 | $feed = new XML_Feed_Parser($content); |
---|
462 | } catch (XML_Feed_Parser_Exception $e) { |
---|
463 | $this->assertTrue(false); |
---|
464 | return; |
---|
465 | } |
---|
466 | $this->assertEquals('en', $feed->getEntryByOffset(0)->links(0, 'hreflang')); |
---|
467 | } |
---|
468 | |
---|
469 | function test_entry_link_length_1 () { |
---|
470 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_link_length.xml'); |
---|
471 | try { |
---|
472 | $feed = new XML_Feed_Parser($content); |
---|
473 | } catch (XML_Feed_Parser_Exception $e) { |
---|
474 | $this->assertTrue(false); |
---|
475 | return; |
---|
476 | } |
---|
477 | $this->assertEquals('42301', $feed->getEntryByOffset(0)->links(0, 'length')); |
---|
478 | } |
---|
479 | |
---|
480 | function test_entry_link_multiple_1 () { |
---|
481 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_link_multiple.xml'); |
---|
482 | try { |
---|
483 | $feed = new XML_Feed_Parser($content); |
---|
484 | } catch (XML_Feed_Parser_Exception $e) { |
---|
485 | $this->assertTrue(false); |
---|
486 | return; |
---|
487 | } |
---|
488 | $this->assertEquals(array(array('rel' => 'alternate', 'type' => 'application/xhtml+xml', 'href' => 'http://www.example.com/'), array('rel' => 'service.post', 'type' => 'application/atom+xml', 'href' => 'http://www.example.com/post')), $feed->getEntryByOffset(0)->links); |
---|
489 | } |
---|
490 | |
---|
491 | function test_entry_link_no_rel_1 () { |
---|
492 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_link_no_rel.xml'); |
---|
493 | try { |
---|
494 | $feed = new XML_Feed_Parser($content); |
---|
495 | } catch (XML_Feed_Parser_Exception $e) { |
---|
496 | $this->assertTrue(false); |
---|
497 | return; |
---|
498 | } |
---|
499 | $this->assertEquals('alternate', $feed->getEntryByOffset(0)->links(0, 'rel')); |
---|
500 | } |
---|
501 | |
---|
502 | function test_entry_link_rel_1 () { |
---|
503 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_link_rel.xml'); |
---|
504 | try { |
---|
505 | $feed = new XML_Feed_Parser($content); |
---|
506 | } catch (XML_Feed_Parser_Exception $e) { |
---|
507 | $this->assertTrue(false); |
---|
508 | return; |
---|
509 | } |
---|
510 | $this->assertEquals('alternate', $feed->getEntryByOffset(0)->links(0, 'rel')); |
---|
511 | } |
---|
512 | |
---|
513 | function test_entry_link_rel_enclosure_1 () { |
---|
514 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_link_rel_enclosure.xml'); |
---|
515 | try { |
---|
516 | $feed = new XML_Feed_Parser($content); |
---|
517 | } catch (XML_Feed_Parser_Exception $e) { |
---|
518 | $this->assertTrue(false); |
---|
519 | return; |
---|
520 | } |
---|
521 | $this->assertEquals('enclosure', $feed->getEntryByOffset(0)->links(0, 'rel')); |
---|
522 | } |
---|
523 | |
---|
524 | function test_entry_link_rel_enclosure_map_enclosure_length_1 () { |
---|
525 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_link_rel_enclosure_map_enclosure_length.xml'); |
---|
526 | try { |
---|
527 | $feed = new XML_Feed_Parser($content); |
---|
528 | } catch (XML_Feed_Parser_Exception $e) { |
---|
529 | $this->assertTrue(false); |
---|
530 | return; |
---|
531 | } |
---|
532 | $this->assertEquals('42301', $feed->getEntryByOffset(0)->enclosures(0, 'length')); |
---|
533 | } |
---|
534 | |
---|
535 | function test_entry_link_rel_enclosure_map_enclosure_type_1 () { |
---|
536 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_link_rel_enclosure_map_enclosure_type.xml'); |
---|
537 | try { |
---|
538 | $feed = new XML_Feed_Parser($content); |
---|
539 | } catch (XML_Feed_Parser_Exception $e) { |
---|
540 | $this->assertTrue(false); |
---|
541 | return; |
---|
542 | } |
---|
543 | $this->assertEquals('video/mpeg4', $feed->getEntryByOffset(0)->enclosures(0, 'type')); |
---|
544 | } |
---|
545 | |
---|
546 | function test_entry_link_rel_enclosure_map_enclosure_url_1 () { |
---|
547 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_link_rel_enclosure_map_enclosure_url.xml'); |
---|
548 | try { |
---|
549 | $feed = new XML_Feed_Parser($content); |
---|
550 | } catch (XML_Feed_Parser_Exception $e) { |
---|
551 | $this->assertTrue(false); |
---|
552 | return; |
---|
553 | } |
---|
554 | $this->assertEquals('http://www.example.com/movie.mp4', $feed->getEntryByOffset(0)->enclosures(0, 'href')); |
---|
555 | } |
---|
556 | |
---|
557 | function test_entry_link_rel_other_1 () { |
---|
558 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_link_rel_other.xml'); |
---|
559 | try { |
---|
560 | $feed = new XML_Feed_Parser($content); |
---|
561 | } catch (XML_Feed_Parser_Exception $e) { |
---|
562 | $this->assertTrue(false); |
---|
563 | return; |
---|
564 | } |
---|
565 | $this->assertEquals('http://feedparser.org/rel/test', $feed->getEntryByOffset(0)->links(0, 'rel')); |
---|
566 | } |
---|
567 | |
---|
568 | function test_entry_link_rel_related_1 () { |
---|
569 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_link_rel_related.xml'); |
---|
570 | try { |
---|
571 | $feed = new XML_Feed_Parser($content); |
---|
572 | } catch (XML_Feed_Parser_Exception $e) { |
---|
573 | $this->assertTrue(false); |
---|
574 | return; |
---|
575 | } |
---|
576 | $this->assertEquals('related', $feed->getEntryByOffset(0)->links(0, 'rel')); |
---|
577 | } |
---|
578 | |
---|
579 | function test_entry_link_rel_self_1 () { |
---|
580 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_link_rel_self.xml'); |
---|
581 | try { |
---|
582 | $feed = new XML_Feed_Parser($content); |
---|
583 | } catch (XML_Feed_Parser_Exception $e) { |
---|
584 | $this->assertTrue(false); |
---|
585 | return; |
---|
586 | } |
---|
587 | $this->assertEquals('self', $feed->getEntryByOffset(0)->links(0, 'rel')); |
---|
588 | } |
---|
589 | |
---|
590 | function test_entry_link_rel_via_1 () { |
---|
591 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_link_rel_via.xml'); |
---|
592 | try { |
---|
593 | $feed = new XML_Feed_Parser($content); |
---|
594 | } catch (XML_Feed_Parser_Exception $e) { |
---|
595 | $this->assertTrue(false); |
---|
596 | return; |
---|
597 | } |
---|
598 | $this->assertEquals('via', $feed->getEntryByOffset(0)->links(0, 'rel')); |
---|
599 | } |
---|
600 | |
---|
601 | function test_entry_link_title_1 () { |
---|
602 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_link_title.xml'); |
---|
603 | try { |
---|
604 | $feed = new XML_Feed_Parser($content); |
---|
605 | } catch (XML_Feed_Parser_Exception $e) { |
---|
606 | $this->assertTrue(false); |
---|
607 | return; |
---|
608 | } |
---|
609 | $this->assertEquals('Example title', $feed->getEntryByOffset(0)->links(0, 'title')); |
---|
610 | } |
---|
611 | |
---|
612 | function test_entry_link_type_1 () { |
---|
613 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_link_type.xml'); |
---|
614 | try { |
---|
615 | $feed = new XML_Feed_Parser($content); |
---|
616 | } catch (XML_Feed_Parser_Exception $e) { |
---|
617 | $this->assertTrue(false); |
---|
618 | return; |
---|
619 | } |
---|
620 | $this->assertEquals('text/html', $feed->getEntryByOffset(0)->links(0, 'type')); |
---|
621 | } |
---|
622 | |
---|
623 | function test_entry_rights_1 () { |
---|
624 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_rights.xml'); |
---|
625 | try { |
---|
626 | $feed = new XML_Feed_Parser($content); |
---|
627 | } catch (XML_Feed_Parser_Exception $e) { |
---|
628 | $this->assertTrue(false); |
---|
629 | return; |
---|
630 | } |
---|
631 | $this->assertEquals('Example Atom', $feed->getEntryByOffset(0)->rights); |
---|
632 | } |
---|
633 | |
---|
634 | function test_entry_rights_content_value_1 () { |
---|
635 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_rights_content_value.xml'); |
---|
636 | try { |
---|
637 | $feed = new XML_Feed_Parser($content); |
---|
638 | } catch (XML_Feed_Parser_Exception $e) { |
---|
639 | $this->assertTrue(false); |
---|
640 | return; |
---|
641 | } |
---|
642 | $this->assertEquals('Example Atom', $feed->getEntryByOffset(0)->rights); |
---|
643 | } |
---|
644 | |
---|
645 | function test_entry_rights_escaped_markup_1 () { |
---|
646 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_rights_escaped_markup.xml'); |
---|
647 | try { |
---|
648 | $feed = new XML_Feed_Parser($content); |
---|
649 | } catch (XML_Feed_Parser_Exception $e) { |
---|
650 | $this->assertTrue(false); |
---|
651 | return; |
---|
652 | } |
---|
653 | $this->assertEquals('Example <b>Atom</b>', $feed->getEntryByOffset(0)->rights); |
---|
654 | } |
---|
655 | |
---|
656 | function test_entry_rights_inline_markup_1 () { |
---|
657 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_rights_inline_markup.xml'); |
---|
658 | try { |
---|
659 | $feed = new XML_Feed_Parser($content); |
---|
660 | } catch (XML_Feed_Parser_Exception $e) { |
---|
661 | $this->assertTrue(false); |
---|
662 | return; |
---|
663 | } |
---|
664 | $this->assertEquals('<div>Example <b>Atom</b></div>', $feed->getEntryByOffset(0)->rights); |
---|
665 | } |
---|
666 | |
---|
667 | function test_entry_rights_inline_markup_2_1 () { |
---|
668 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_rights_inline_markup_2.xml'); |
---|
669 | try { |
---|
670 | $feed = new XML_Feed_Parser($content); |
---|
671 | } catch (XML_Feed_Parser_Exception $e) { |
---|
672 | $this->assertTrue(false); |
---|
673 | return; |
---|
674 | } |
---|
675 | $this->assertEquals('<div>History of the <blink> tag</div>', $feed->getEntryByOffset(0)->rights); |
---|
676 | } |
---|
677 | |
---|
678 | function test_entry_rights_text_plain_1 () { |
---|
679 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_rights_text_plain.xml'); |
---|
680 | try { |
---|
681 | $feed = new XML_Feed_Parser($content); |
---|
682 | } catch (XML_Feed_Parser_Exception $e) { |
---|
683 | $this->assertTrue(false); |
---|
684 | return; |
---|
685 | } |
---|
686 | $this->assertEquals('Example Atom', $feed->getEntryByOffset(0)->rights); |
---|
687 | } |
---|
688 | |
---|
689 | function test_entry_rights_text_plain_brackets_1 () { |
---|
690 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_rights_text_plain_brackets.xml'); |
---|
691 | try { |
---|
692 | $feed = new XML_Feed_Parser($content); |
---|
693 | } catch (XML_Feed_Parser_Exception $e) { |
---|
694 | $this->assertTrue(false); |
---|
695 | return; |
---|
696 | } |
---|
697 | $this->assertEquals('History of the <blink> tag', $feed->getEntryByOffset(0)->rights); |
---|
698 | } |
---|
699 | |
---|
700 | function test_entry_rights_type_default_1 () { |
---|
701 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_rights_type_default.xml'); |
---|
702 | try { |
---|
703 | $feed = new XML_Feed_Parser($content); |
---|
704 | } catch (XML_Feed_Parser_Exception $e) { |
---|
705 | $this->assertTrue(false); |
---|
706 | return; |
---|
707 | } |
---|
708 | $this->assertEquals('text/plain', $feed->getEntryByOffset(0)->rights(0, 'type')); |
---|
709 | } |
---|
710 | |
---|
711 | function test_entry_rights_type_text_1 () { |
---|
712 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_rights_type_text.xml'); |
---|
713 | try { |
---|
714 | $feed = new XML_Feed_Parser($content); |
---|
715 | } catch (XML_Feed_Parser_Exception $e) { |
---|
716 | $this->assertTrue(false); |
---|
717 | return; |
---|
718 | } |
---|
719 | $this->assertEquals('text/plain', $feed->getEntryByOffset(0)->rights(0, 'type')); |
---|
720 | } |
---|
721 | |
---|
722 | function test_entry_source_author_email_1 () { |
---|
723 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_source_author_email.xml'); |
---|
724 | try { |
---|
725 | $feed = new XML_Feed_Parser($content); |
---|
726 | } catch (XML_Feed_Parser_Exception $e) { |
---|
727 | $this->assertTrue(false); |
---|
728 | return; |
---|
729 | } |
---|
730 | $this->assertEquals('me@example.com', $feed->getEntryByOffset(0)->source(0, 'author(0, 'email')')); |
---|
731 | } |
---|
732 | |
---|
733 | function test_entry_source_author_map_author_1 () { |
---|
734 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_source_author_map_author.xml'); |
---|
735 | try { |
---|
736 | $feed = new XML_Feed_Parser($content); |
---|
737 | } catch (XML_Feed_Parser_Exception $e) { |
---|
738 | $this->assertTrue(false); |
---|
739 | return; |
---|
740 | } |
---|
741 | $this->assertEquals('Example author (me@example.com)', $feed->getEntryByOffset(0)->source(0, 'author')); |
---|
742 | } |
---|
743 | |
---|
744 | function test_entry_source_author_map_author_2_1 () { |
---|
745 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_source_author_map_author_2.xml'); |
---|
746 | try { |
---|
747 | $feed = new XML_Feed_Parser($content); |
---|
748 | } catch (XML_Feed_Parser_Exception $e) { |
---|
749 | $this->assertTrue(false); |
---|
750 | return; |
---|
751 | } |
---|
752 | $this->assertEquals('Example author', $feed->getEntryByOffset(0)->source(0, 'author')); |
---|
753 | } |
---|
754 | |
---|
755 | function test_entry_source_author_name_1 () { |
---|
756 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_source_author_name.xml'); |
---|
757 | try { |
---|
758 | $feed = new XML_Feed_Parser($content); |
---|
759 | } catch (XML_Feed_Parser_Exception $e) { |
---|
760 | $this->assertTrue(false); |
---|
761 | return; |
---|
762 | } |
---|
763 | $this->assertEquals('Example author', $feed->getEntryByOffset(0)->source(0, 'author(0, 'name')')); |
---|
764 | } |
---|
765 | |
---|
766 | function test_entry_source_author_uri_1 () { |
---|
767 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_source_author_uri.xml'); |
---|
768 | try { |
---|
769 | $feed = new XML_Feed_Parser($content); |
---|
770 | } catch (XML_Feed_Parser_Exception $e) { |
---|
771 | $this->assertTrue(false); |
---|
772 | return; |
---|
773 | } |
---|
774 | $this->assertEquals('http://example.com/', $feed->getEntryByOffset(0)->source(0, 'author(0, 'url')')); |
---|
775 | } |
---|
776 | |
---|
777 | function test_entry_source_category_label_1 () { |
---|
778 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_source_category_label.xml'); |
---|
779 | try { |
---|
780 | $feed = new XML_Feed_Parser($content); |
---|
781 | } catch (XML_Feed_Parser_Exception $e) { |
---|
782 | $this->assertTrue(false); |
---|
783 | return; |
---|
784 | } |
---|
785 | $this->assertEquals('Atom 1.0 tests', $feed->getEntryByOffset(0)->source(0, 'tags->label')); |
---|
786 | } |
---|
787 | |
---|
788 | function test_entry_source_category_scheme_1 () { |
---|
789 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_source_category_scheme.xml'); |
---|
790 | try { |
---|
791 | $feed = new XML_Feed_Parser($content); |
---|
792 | } catch (XML_Feed_Parser_Exception $e) { |
---|
793 | $this->assertTrue(false); |
---|
794 | return; |
---|
795 | } |
---|
796 | $this->assertEquals('http://feedparser.org/tests/', $feed->getEntryByOffset(0)->source(0, 'tags->scheme')); |
---|
797 | } |
---|
798 | |
---|
799 | function test_entry_source_category_term_1 () { |
---|
800 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_source_category_term.xml'); |
---|
801 | try { |
---|
802 | $feed = new XML_Feed_Parser($content); |
---|
803 | } catch (XML_Feed_Parser_Exception $e) { |
---|
804 | $this->assertTrue(false); |
---|
805 | return; |
---|
806 | } |
---|
807 | $this->assertEquals('atom10', $feed->getEntryByOffset(0)->source(0, 'tags->term')); |
---|
808 | } |
---|
809 | |
---|
810 | function test_entry_source_contributor_email_1 () { |
---|
811 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_source_contributor_email.xml'); |
---|
812 | try { |
---|
813 | $feed = new XML_Feed_Parser($content); |
---|
814 | } catch (XML_Feed_Parser_Exception $e) { |
---|
815 | $this->assertTrue(false); |
---|
816 | return; |
---|
817 | } |
---|
818 | $this->assertEquals('me@example.com', $feed->getEntryByOffset(0)->source(0, 'contributors->email')); |
---|
819 | } |
---|
820 | |
---|
821 | function test_entry_source_contributor_multiple_1 () { |
---|
822 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_source_contributor_multiple.xml'); |
---|
823 | try { |
---|
824 | $feed = new XML_Feed_Parser($content); |
---|
825 | } catch (XML_Feed_Parser_Exception $e) { |
---|
826 | $this->assertTrue(false); |
---|
827 | return; |
---|
828 | } |
---|
829 | $this->assertEquals(array(array('name' => 'Contributor 1', 'email' => 'me@example.com', 'href' => 'http://example.com/'), array('name' => 'Contributor 2', 'email' => 'you@example.com', 'href' => 'http://two.example.com/')), $feed->getEntryByOffset(0)->source(0, 'contributors')); |
---|
830 | } |
---|
831 | |
---|
832 | function test_entry_source_contributor_name_1 () { |
---|
833 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_source_contributor_name.xml'); |
---|
834 | try { |
---|
835 | $feed = new XML_Feed_Parser($content); |
---|
836 | } catch (XML_Feed_Parser_Exception $e) { |
---|
837 | $this->assertTrue(false); |
---|
838 | return; |
---|
839 | } |
---|
840 | $this->assertEquals('Example contributor', $feed->getEntryByOffset(0)->source(0, 'contributors->name')); |
---|
841 | } |
---|
842 | |
---|
843 | function test_entry_source_contributor_uri_1 () { |
---|
844 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_source_contributor_uri.xml'); |
---|
845 | try { |
---|
846 | $feed = new XML_Feed_Parser($content); |
---|
847 | } catch (XML_Feed_Parser_Exception $e) { |
---|
848 | $this->assertTrue(false); |
---|
849 | return; |
---|
850 | } |
---|
851 | $this->assertEquals('http://example.com/', $feed->getEntryByOffset(0)->source(0, 'contributors->url')); |
---|
852 | } |
---|
853 | |
---|
854 | function test_entry_source_generator_1 () { |
---|
855 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_source_generator.xml'); |
---|
856 | try { |
---|
857 | $feed = new XML_Feed_Parser($content); |
---|
858 | } catch (XML_Feed_Parser_Exception $e) { |
---|
859 | $this->assertTrue(false); |
---|
860 | return; |
---|
861 | } |
---|
862 | $this->assertEquals('Example generator', $feed->getEntryByOffset(0)->source(0, 'generator')); |
---|
863 | } |
---|
864 | |
---|
865 | function test_entry_source_generator_name_1 () { |
---|
866 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_source_generator_name.xml'); |
---|
867 | try { |
---|
868 | $feed = new XML_Feed_Parser($content); |
---|
869 | } catch (XML_Feed_Parser_Exception $e) { |
---|
870 | $this->assertTrue(false); |
---|
871 | return; |
---|
872 | } |
---|
873 | $this->assertEquals('Example generator', $feed->getEntryByOffset(0)->source(0, 'generator(0, 'name')')); |
---|
874 | } |
---|
875 | |
---|
876 | function test_entry_source_generator_uri_1 () { |
---|
877 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_source_generator_uri.xml'); |
---|
878 | try { |
---|
879 | $feed = new XML_Feed_Parser($content); |
---|
880 | } catch (XML_Feed_Parser_Exception $e) { |
---|
881 | $this->assertTrue(false); |
---|
882 | return; |
---|
883 | } |
---|
884 | $this->assertEquals('http://example.com/', $feed->getEntryByOffset(0)->source(0, 'generator(0, 'href')')); |
---|
885 | } |
---|
886 | |
---|
887 | function test_entry_source_generator_version_1 () { |
---|
888 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_source_generator_version.xml'); |
---|
889 | try { |
---|
890 | $feed = new XML_Feed_Parser($content); |
---|
891 | } catch (XML_Feed_Parser_Exception $e) { |
---|
892 | $this->assertTrue(false); |
---|
893 | return; |
---|
894 | } |
---|
895 | $this->assertEquals('2.65', $feed->getEntryByOffset(0)->source(0, 'generator(0, 'version')')); |
---|
896 | } |
---|
897 | |
---|
898 | function test_entry_source_icon_1 () { |
---|
899 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_source_icon.xml'); |
---|
900 | try { |
---|
901 | $feed = new XML_Feed_Parser($content); |
---|
902 | } catch (XML_Feed_Parser_Exception $e) { |
---|
903 | $this->assertTrue(false); |
---|
904 | return; |
---|
905 | } |
---|
906 | $this->assertEquals('http://example.com/favicon.ico', $feed->getEntryByOffset(0)->source(0, 'icon')); |
---|
907 | } |
---|
908 | |
---|
909 | function test_entry_source_id_1 () { |
---|
910 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_source_id.xml'); |
---|
911 | try { |
---|
912 | $feed = new XML_Feed_Parser($content); |
---|
913 | } catch (XML_Feed_Parser_Exception $e) { |
---|
914 | $this->assertTrue(false); |
---|
915 | return; |
---|
916 | } |
---|
917 | $this->assertEquals('http://example.com/', $feed->getEntryByOffset(0)->source(0, 'id')); |
---|
918 | } |
---|
919 | |
---|
920 | function test_entry_source_link_alternate_map_link_1 () { |
---|
921 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_source_link_alternate_map_link.xml'); |
---|
922 | try { |
---|
923 | $feed = new XML_Feed_Parser($content); |
---|
924 | } catch (XML_Feed_Parser_Exception $e) { |
---|
925 | $this->assertTrue(false); |
---|
926 | return; |
---|
927 | } |
---|
928 | $this->assertEquals('http://www.example.com/', $feed->getEntryByOffset(0)->source(0, 'link')); |
---|
929 | } |
---|
930 | |
---|
931 | function test_entry_source_link_alternate_map_link_2_1 () { |
---|
932 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_source_link_alternate_map_link_2.xml'); |
---|
933 | try { |
---|
934 | $feed = new XML_Feed_Parser($content); |
---|
935 | } catch (XML_Feed_Parser_Exception $e) { |
---|
936 | $this->assertTrue(false); |
---|
937 | return; |
---|
938 | } |
---|
939 | $this->assertEquals('http://www.example.com/', $feed->getEntryByOffset(0)->source(0, 'link')); |
---|
940 | } |
---|
941 | |
---|
942 | function test_entry_source_link_href_1 () { |
---|
943 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_source_link_href.xml'); |
---|
944 | try { |
---|
945 | $feed = new XML_Feed_Parser($content); |
---|
946 | } catch (XML_Feed_Parser_Exception $e) { |
---|
947 | $this->assertTrue(false); |
---|
948 | return; |
---|
949 | } |
---|
950 | $this->assertEquals('http://www.example.com/', $feed->getEntryByOffset(0)->source(0, 'links->href')); |
---|
951 | } |
---|
952 | |
---|
953 | function test_entry_source_link_hreflang_1 () { |
---|
954 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_source_link_hreflang.xml'); |
---|
955 | try { |
---|
956 | $feed = new XML_Feed_Parser($content); |
---|
957 | } catch (XML_Feed_Parser_Exception $e) { |
---|
958 | $this->assertTrue(false); |
---|
959 | return; |
---|
960 | } |
---|
961 | $this->assertEquals('en', $feed->getEntryByOffset(0)->source(0, 'links->hreflang')); |
---|
962 | } |
---|
963 | |
---|
964 | function test_entry_source_link_length_1 () { |
---|
965 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_source_link_length.xml'); |
---|
966 | try { |
---|
967 | $feed = new XML_Feed_Parser($content); |
---|
968 | } catch (XML_Feed_Parser_Exception $e) { |
---|
969 | $this->assertTrue(false); |
---|
970 | return; |
---|
971 | } |
---|
972 | $this->assertEquals('42301', $feed->getEntryByOffset(0)->source(0, 'links->length')); |
---|
973 | } |
---|
974 | |
---|
975 | function test_entry_source_link_multiple_1 () { |
---|
976 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_source_link_multiple.xml'); |
---|
977 | try { |
---|
978 | $feed = new XML_Feed_Parser($content); |
---|
979 | } catch (XML_Feed_Parser_Exception $e) { |
---|
980 | $this->assertTrue(false); |
---|
981 | return; |
---|
982 | } |
---|
983 | $this->assertEquals(array(array('rel' => 'alternate', 'type' => 'application/xhtml+xml', 'href' => 'http://www.example.com/'), array('rel' => 'service.post', 'type' => 'application/atom+xml', 'href' => 'http://www.example.com/post')), $feed->getEntryByOffset(0)->source(0, 'links')); |
---|
984 | } |
---|
985 | |
---|
986 | function test_entry_source_link_no_rel_1 () { |
---|
987 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_source_link_no_rel.xml'); |
---|
988 | try { |
---|
989 | $feed = new XML_Feed_Parser($content); |
---|
990 | } catch (XML_Feed_Parser_Exception $e) { |
---|
991 | $this->assertTrue(false); |
---|
992 | return; |
---|
993 | } |
---|
994 | $this->assertEquals('alternate', $feed->getEntryByOffset(0)->source(0, 'links->rel')); |
---|
995 | } |
---|
996 | |
---|
997 | function test_entry_source_link_rel_1 () { |
---|
998 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_source_link_rel.xml'); |
---|
999 | try { |
---|
1000 | $feed = new XML_Feed_Parser($content); |
---|
1001 | } catch (XML_Feed_Parser_Exception $e) { |
---|
1002 | $this->assertTrue(false); |
---|
1003 | return; |
---|
1004 | } |
---|
1005 | $this->assertEquals('alternate', $feed->getEntryByOffset(0)->source(0, 'links->rel')); |
---|
1006 | } |
---|
1007 | |
---|
1008 | function test_entry_source_link_rel_other_1 () { |
---|
1009 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_source_link_rel_other.xml'); |
---|
1010 | try { |
---|
1011 | $feed = new XML_Feed_Parser($content); |
---|
1012 | } catch (XML_Feed_Parser_Exception $e) { |
---|
1013 | $this->assertTrue(false); |
---|
1014 | return; |
---|
1015 | } |
---|
1016 | $this->assertEquals('http://feedparser.org/rel/test', $feed->getEntryByOffset(0)->source(0, 'links->rel')); |
---|
1017 | } |
---|
1018 | |
---|
1019 | function test_entry_source_link_rel_related_1 () { |
---|
1020 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_source_link_rel_related.xml'); |
---|
1021 | try { |
---|
1022 | $feed = new XML_Feed_Parser($content); |
---|
1023 | } catch (XML_Feed_Parser_Exception $e) { |
---|
1024 | $this->assertTrue(false); |
---|
1025 | return; |
---|
1026 | } |
---|
1027 | $this->assertEquals('related', $feed->getEntryByOffset(0)->source(0, 'links->rel')); |
---|
1028 | } |
---|
1029 | |
---|
1030 | function test_entry_source_link_rel_self_1 () { |
---|
1031 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_source_link_rel_self.xml'); |
---|
1032 | try { |
---|
1033 | $feed = new XML_Feed_Parser($content); |
---|
1034 | } catch (XML_Feed_Parser_Exception $e) { |
---|
1035 | $this->assertTrue(false); |
---|
1036 | return; |
---|
1037 | } |
---|
1038 | $this->assertEquals('self', $feed->getEntryByOffset(0)->source(0, 'links->rel')); |
---|
1039 | } |
---|
1040 | |
---|
1041 | function test_entry_source_link_rel_via_1 () { |
---|
1042 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_source_link_rel_via.xml'); |
---|
1043 | try { |
---|
1044 | $feed = new XML_Feed_Parser($content); |
---|
1045 | } catch (XML_Feed_Parser_Exception $e) { |
---|
1046 | $this->assertTrue(false); |
---|
1047 | return; |
---|
1048 | } |
---|
1049 | $this->assertEquals('via', $feed->getEntryByOffset(0)->source(0, 'links->rel')); |
---|
1050 | } |
---|
1051 | |
---|
1052 | function test_entry_source_link_title_1 () { |
---|
1053 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_source_link_title.xml'); |
---|
1054 | try { |
---|
1055 | $feed = new XML_Feed_Parser($content); |
---|
1056 | } catch (XML_Feed_Parser_Exception $e) { |
---|
1057 | $this->assertTrue(false); |
---|
1058 | return; |
---|
1059 | } |
---|
1060 | $this->assertEquals('Example title', $feed->getEntryByOffset(0)->source(0, 'links->title')); |
---|
1061 | } |
---|
1062 | |
---|
1063 | function test_entry_source_link_type_1 () { |
---|
1064 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_source_link_type.xml'); |
---|
1065 | try { |
---|
1066 | $feed = new XML_Feed_Parser($content); |
---|
1067 | } catch (XML_Feed_Parser_Exception $e) { |
---|
1068 | $this->assertTrue(false); |
---|
1069 | return; |
---|
1070 | } |
---|
1071 | $this->assertEquals('text/html', $feed->getEntryByOffset(0)->source(0, 'links->type')); |
---|
1072 | } |
---|
1073 | |
---|
1074 | function test_entry_source_logo_1 () { |
---|
1075 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_source_logo.xml'); |
---|
1076 | try { |
---|
1077 | $feed = new XML_Feed_Parser($content); |
---|
1078 | } catch (XML_Feed_Parser_Exception $e) { |
---|
1079 | $this->assertTrue(false); |
---|
1080 | return; |
---|
1081 | } |
---|
1082 | $this->assertEquals('http://example.com/logo.jpg', $feed->getEntryByOffset(0)->source(0, 'logo')); |
---|
1083 | } |
---|
1084 | |
---|
1085 | function test_entry_source_rights_1 () { |
---|
1086 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_source_rights.xml'); |
---|
1087 | try { |
---|
1088 | $feed = new XML_Feed_Parser($content); |
---|
1089 | } catch (XML_Feed_Parser_Exception $e) { |
---|
1090 | $this->assertTrue(false); |
---|
1091 | return; |
---|
1092 | } |
---|
1093 | $this->assertEquals('Example Atom', $feed->getEntryByOffset(0)->source(0, 'rights')); |
---|
1094 | } |
---|
1095 | |
---|
1096 | function test_entry_source_rights_base64_1 () { |
---|
1097 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_source_rights_base64.xml'); |
---|
1098 | try { |
---|
1099 | $feed = new XML_Feed_Parser($content); |
---|
1100 | } catch (XML_Feed_Parser_Exception $e) { |
---|
1101 | $this->assertTrue(false); |
---|
1102 | return; |
---|
1103 | } |
---|
1104 | $this->assertEquals('Example <b>Atom</b>', $feed->getEntryByOffset(0)->source(0, 'rights')); |
---|
1105 | } |
---|
1106 | |
---|
1107 | function test_entry_source_rights_base64_2_1 () { |
---|
1108 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_source_rights_base64_2.xml'); |
---|
1109 | try { |
---|
1110 | $feed = new XML_Feed_Parser($content); |
---|
1111 | } catch (XML_Feed_Parser_Exception $e) { |
---|
1112 | $this->assertTrue(false); |
---|
1113 | return; |
---|
1114 | } |
---|
1115 | $this->assertEquals('<p>History of the <blink> tag</p>', $feed->getEntryByOffset(0)->source(0, 'rights')); |
---|
1116 | } |
---|
1117 | |
---|
1118 | function test_entry_source_rights_content_type_1 () { |
---|
1119 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_source_rights_content_type.xml'); |
---|
1120 | try { |
---|
1121 | $feed = new XML_Feed_Parser($content); |
---|
1122 | } catch (XML_Feed_Parser_Exception $e) { |
---|
1123 | $this->assertTrue(false); |
---|
1124 | return; |
---|
1125 | } |
---|
1126 | $this->assertEquals('text/plain', $feed->getEntryByOffset(0)->source(0, 'rights(0, 'type')')); |
---|
1127 | } |
---|
1128 | |
---|
1129 | function test_entry_source_rights_content_type_text_1 () { |
---|
1130 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_source_rights_content_type_text.xml'); |
---|
1131 | try { |
---|
1132 | $feed = new XML_Feed_Parser($content); |
---|
1133 | } catch (XML_Feed_Parser_Exception $e) { |
---|
1134 | $this->assertTrue(false); |
---|
1135 | return; |
---|
1136 | } |
---|
1137 | $this->assertEquals('text/plain', $feed->getEntryByOffset(0)->source(0, 'rights(0, 'type')')); |
---|
1138 | } |
---|
1139 | |
---|
1140 | function test_entry_source_rights_content_value_1 () { |
---|
1141 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_source_rights_content_value.xml'); |
---|
1142 | try { |
---|
1143 | $feed = new XML_Feed_Parser($content); |
---|
1144 | } catch (XML_Feed_Parser_Exception $e) { |
---|
1145 | $this->assertTrue(false); |
---|
1146 | return; |
---|
1147 | } |
---|
1148 | $this->assertEquals('Example Atom', $feed->getEntryByOffset(0)->source(0, 'rights')); |
---|
1149 | } |
---|
1150 | |
---|
1151 | function test_entry_source_rights_escaped_markup_1 () { |
---|
1152 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_source_rights_escaped_markup.xml'); |
---|
1153 | try { |
---|
1154 | $feed = new XML_Feed_Parser($content); |
---|
1155 | } catch (XML_Feed_Parser_Exception $e) { |
---|
1156 | $this->assertTrue(false); |
---|
1157 | return; |
---|
1158 | } |
---|
1159 | $this->assertEquals('Example <b>Atom</b>', $feed->getEntryByOffset(0)->source(0, 'rights')); |
---|
1160 | } |
---|
1161 | |
---|
1162 | function test_entry_source_rights_inline_markup_1 () { |
---|
1163 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_source_rights_inline_markup.xml'); |
---|
1164 | try { |
---|
1165 | $feed = new XML_Feed_Parser($content); |
---|
1166 | } catch (XML_Feed_Parser_Exception $e) { |
---|
1167 | $this->assertTrue(false); |
---|
1168 | return; |
---|
1169 | } |
---|
1170 | $this->assertEquals('<div>Example <b>Atom</b></div>', $feed->getEntryByOffset(0)->source(0, 'rights')); |
---|
1171 | } |
---|
1172 | |
---|
1173 | function test_entry_source_rights_inline_markup_2_1 () { |
---|
1174 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_source_rights_inline_markup_2.xml'); |
---|
1175 | try { |
---|
1176 | $feed = new XML_Feed_Parser($content); |
---|
1177 | } catch (XML_Feed_Parser_Exception $e) { |
---|
1178 | $this->assertTrue(false); |
---|
1179 | return; |
---|
1180 | } |
---|
1181 | $this->assertEquals('<div>History of the <blink> tag</div>', $feed->getEntryByOffset(0)->source(0, 'rights')); |
---|
1182 | } |
---|
1183 | |
---|
1184 | function test_entry_source_rights_text_plain_1 () { |
---|
1185 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_source_rights_text_plain.xml'); |
---|
1186 | try { |
---|
1187 | $feed = new XML_Feed_Parser($content); |
---|
1188 | } catch (XML_Feed_Parser_Exception $e) { |
---|
1189 | $this->assertTrue(false); |
---|
1190 | return; |
---|
1191 | } |
---|
1192 | $this->assertEquals('Example Atom', $feed->getEntryByOffset(0)->source(0, 'rights')); |
---|
1193 | } |
---|
1194 | |
---|
1195 | function test_entry_source_subittle_content_type_text_1 () { |
---|
1196 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_source_subittle_content_type_text.xml'); |
---|
1197 | try { |
---|
1198 | $feed = new XML_Feed_Parser($content); |
---|
1199 | } catch (XML_Feed_Parser_Exception $e) { |
---|
1200 | $this->assertTrue(false); |
---|
1201 | return; |
---|
1202 | } |
---|
1203 | $this->assertEquals('text/plain', $feed->getEntryByOffset(0)->source(0, 'subtitle(0, 'type')')); |
---|
1204 | } |
---|
1205 | |
---|
1206 | function test_entry_source_subtitle_1 () { |
---|
1207 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_source_subtitle.xml'); |
---|
1208 | try { |
---|
1209 | $feed = new XML_Feed_Parser($content); |
---|
1210 | } catch (XML_Feed_Parser_Exception $e) { |
---|
1211 | $this->assertTrue(false); |
---|
1212 | return; |
---|
1213 | } |
---|
1214 | $this->assertEquals('Example Atom', $feed->getEntryByOffset(0)->source(0, 'subtitle')); |
---|
1215 | } |
---|
1216 | |
---|
1217 | function test_entry_source_subtitle_base64_1 () { |
---|
1218 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_source_subtitle_base64.xml'); |
---|
1219 | try { |
---|
1220 | $feed = new XML_Feed_Parser($content); |
---|
1221 | } catch (XML_Feed_Parser_Exception $e) { |
---|
1222 | $this->assertTrue(false); |
---|
1223 | return; |
---|
1224 | } |
---|
1225 | $this->assertEquals('Example <b>Atom</b>', $feed->getEntryByOffset(0)->source(0, 'subtitle')); |
---|
1226 | } |
---|
1227 | |
---|
1228 | function test_entry_source_subtitle_base64_2_1 () { |
---|
1229 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_source_subtitle_base64_2.xml'); |
---|
1230 | try { |
---|
1231 | $feed = new XML_Feed_Parser($content); |
---|
1232 | } catch (XML_Feed_Parser_Exception $e) { |
---|
1233 | $this->assertTrue(false); |
---|
1234 | return; |
---|
1235 | } |
---|
1236 | $this->assertEquals('<p>History of the <blink> tag</p>', $feed->getEntryByOffset(0)->source(0, 'subtitle')); |
---|
1237 | } |
---|
1238 | |
---|
1239 | function test_entry_source_subtitle_content_type_1 () { |
---|
1240 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_source_subtitle_content_type.xml'); |
---|
1241 | try { |
---|
1242 | $feed = new XML_Feed_Parser($content); |
---|
1243 | } catch (XML_Feed_Parser_Exception $e) { |
---|
1244 | $this->assertTrue(false); |
---|
1245 | return; |
---|
1246 | } |
---|
1247 | $this->assertEquals('text/plain', $feed->getEntryByOffset(0)->source(0, 'subtitle(0, 'type')')); |
---|
1248 | } |
---|
1249 | |
---|
1250 | function test_entry_source_subtitle_content_value_1 () { |
---|
1251 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_source_subtitle_content_value.xml'); |
---|
1252 | try { |
---|
1253 | $feed = new XML_Feed_Parser($content); |
---|
1254 | } catch (XML_Feed_Parser_Exception $e) { |
---|
1255 | $this->assertTrue(false); |
---|
1256 | return; |
---|
1257 | } |
---|
1258 | $this->assertEquals('Example Atom', $feed->getEntryByOffset(0)->source(0, 'subtitle')); |
---|
1259 | } |
---|
1260 | |
---|
1261 | function test_entry_source_subtitle_escaped_markup_1 () { |
---|
1262 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_source_subtitle_escaped_markup.xml'); |
---|
1263 | try { |
---|
1264 | $feed = new XML_Feed_Parser($content); |
---|
1265 | } catch (XML_Feed_Parser_Exception $e) { |
---|
1266 | $this->assertTrue(false); |
---|
1267 | return; |
---|
1268 | } |
---|
1269 | $this->assertEquals('Example <b>Atom</b>', $feed->getEntryByOffset(0)->source(0, 'subtitle')); |
---|
1270 | } |
---|
1271 | |
---|
1272 | function test_entry_source_subtitle_inline_markup_1 () { |
---|
1273 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_source_subtitle_inline_markup.xml'); |
---|
1274 | try { |
---|
1275 | $feed = new XML_Feed_Parser($content); |
---|
1276 | } catch (XML_Feed_Parser_Exception $e) { |
---|
1277 | $this->assertTrue(false); |
---|
1278 | return; |
---|
1279 | } |
---|
1280 | $this->assertEquals('<div>Example <b>Atom</b></div>', $feed->getEntryByOffset(0)->source(0, 'subtitle')); |
---|
1281 | } |
---|
1282 | |
---|
1283 | function test_entry_source_subtitle_inline_markup_2_1 () { |
---|
1284 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_source_subtitle_inline_markup_2.xml'); |
---|
1285 | try { |
---|
1286 | $feed = new XML_Feed_Parser($content); |
---|
1287 | } catch (XML_Feed_Parser_Exception $e) { |
---|
1288 | $this->assertTrue(false); |
---|
1289 | return; |
---|
1290 | } |
---|
1291 | $this->assertEquals('<div>History of the <blink> tag</div>', $feed->getEntryByOffset(0)->source(0, 'subtitle')); |
---|
1292 | } |
---|
1293 | |
---|
1294 | function test_entry_source_subtitle_text_plain_1 () { |
---|
1295 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_source_subtitle_text_plain.xml'); |
---|
1296 | try { |
---|
1297 | $feed = new XML_Feed_Parser($content); |
---|
1298 | } catch (XML_Feed_Parser_Exception $e) { |
---|
1299 | $this->assertTrue(false); |
---|
1300 | return; |
---|
1301 | } |
---|
1302 | $this->assertEquals('Example Atom', $feed->getEntryByOffset(0)->source(0, 'subtitle')); |
---|
1303 | } |
---|
1304 | |
---|
1305 | function test_entry_source_title_1 () { |
---|
1306 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_source_title.xml'); |
---|
1307 | try { |
---|
1308 | $feed = new XML_Feed_Parser($content); |
---|
1309 | } catch (XML_Feed_Parser_Exception $e) { |
---|
1310 | $this->assertTrue(false); |
---|
1311 | return; |
---|
1312 | } |
---|
1313 | $this->assertEquals('Example Atom', $feed->getEntryByOffset(0)->source(0, 'title')); |
---|
1314 | } |
---|
1315 | |
---|
1316 | function test_entry_source_title_base64_1 () { |
---|
1317 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_source_title_base64.xml'); |
---|
1318 | try { |
---|
1319 | $feed = new XML_Feed_Parser($content); |
---|
1320 | } catch (XML_Feed_Parser_Exception $e) { |
---|
1321 | $this->assertTrue(false); |
---|
1322 | return; |
---|
1323 | } |
---|
1324 | $this->assertEquals('Example <b>Atom</b>', $feed->getEntryByOffset(0)->source(0, 'title')); |
---|
1325 | } |
---|
1326 | |
---|
1327 | function test_entry_source_title_base64_2_1 () { |
---|
1328 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_source_title_base64_2.xml'); |
---|
1329 | try { |
---|
1330 | $feed = new XML_Feed_Parser($content); |
---|
1331 | } catch (XML_Feed_Parser_Exception $e) { |
---|
1332 | $this->assertTrue(false); |
---|
1333 | return; |
---|
1334 | } |
---|
1335 | $this->assertEquals('<p>History of the <blink> tag</p>', $feed->getEntryByOffset(0)->source(0, 'title')); |
---|
1336 | } |
---|
1337 | |
---|
1338 | function test_entry_source_title_content_type_1 () { |
---|
1339 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_source_title_content_type.xml'); |
---|
1340 | try { |
---|
1341 | $feed = new XML_Feed_Parser($content); |
---|
1342 | } catch (XML_Feed_Parser_Exception $e) { |
---|
1343 | $this->assertTrue(false); |
---|
1344 | return; |
---|
1345 | } |
---|
1346 | $this->assertEquals('text/plain', $feed->getEntryByOffset(0)->source(0, 'title(0, 'type')')); |
---|
1347 | } |
---|
1348 | |
---|
1349 | function test_entry_source_title_content_type_text_1 () { |
---|
1350 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_source_title_content_type_text.xml'); |
---|
1351 | try { |
---|
1352 | $feed = new XML_Feed_Parser($content); |
---|
1353 | } catch (XML_Feed_Parser_Exception $e) { |
---|
1354 | $this->assertTrue(false); |
---|
1355 | return; |
---|
1356 | } |
---|
1357 | $this->assertEquals('text/plain', $feed->getEntryByOffset(0)->source(0, 'title(0, 'type')')); |
---|
1358 | } |
---|
1359 | |
---|
1360 | function test_entry_source_title_content_value_1 () { |
---|
1361 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_source_title_content_value.xml'); |
---|
1362 | try { |
---|
1363 | $feed = new XML_Feed_Parser($content); |
---|
1364 | } catch (XML_Feed_Parser_Exception $e) { |
---|
1365 | $this->assertTrue(false); |
---|
1366 | return; |
---|
1367 | } |
---|
1368 | $this->assertEquals('Example Atom', $feed->getEntryByOffset(0)->source(0, 'title')); |
---|
1369 | } |
---|
1370 | |
---|
1371 | function test_entry_source_title_escaped_markup_1 () { |
---|
1372 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_source_title_escaped_markup.xml'); |
---|
1373 | try { |
---|
1374 | $feed = new XML_Feed_Parser($content); |
---|
1375 | } catch (XML_Feed_Parser_Exception $e) { |
---|
1376 | $this->assertTrue(false); |
---|
1377 | return; |
---|
1378 | } |
---|
1379 | $this->assertEquals('Example <b>Atom</b>', $feed->getEntryByOffset(0)->source(0, 'title')); |
---|
1380 | } |
---|
1381 | |
---|
1382 | function test_entry_source_title_inline_markup_1 () { |
---|
1383 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_source_title_inline_markup.xml'); |
---|
1384 | try { |
---|
1385 | $feed = new XML_Feed_Parser($content); |
---|
1386 | } catch (XML_Feed_Parser_Exception $e) { |
---|
1387 | $this->assertTrue(false); |
---|
1388 | return; |
---|
1389 | } |
---|
1390 | $this->assertEquals('<div>Example <b>Atom</b></div>', $feed->getEntryByOffset(0)->source(0, 'title')); |
---|
1391 | } |
---|
1392 | |
---|
1393 | function test_entry_source_title_inline_markup_2_1 () { |
---|
1394 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_source_title_inline_markup_2.xml'); |
---|
1395 | try { |
---|
1396 | $feed = new XML_Feed_Parser($content); |
---|
1397 | } catch (XML_Feed_Parser_Exception $e) { |
---|
1398 | $this->assertTrue(false); |
---|
1399 | return; |
---|
1400 | } |
---|
1401 | $this->assertEquals('<div>History of the <blink> tag</div>', $feed->getEntryByOffset(0)->source(0, 'title')); |
---|
1402 | } |
---|
1403 | |
---|
1404 | function test_entry_source_title_text_plain_1 () { |
---|
1405 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_source_title_text_plain.xml'); |
---|
1406 | try { |
---|
1407 | $feed = new XML_Feed_Parser($content); |
---|
1408 | } catch (XML_Feed_Parser_Exception $e) { |
---|
1409 | $this->assertTrue(false); |
---|
1410 | return; |
---|
1411 | } |
---|
1412 | $this->assertEquals('Example Atom', $feed->getEntryByOffset(0)->source(0, 'title')); |
---|
1413 | } |
---|
1414 | |
---|
1415 | function test_entry_summary_1 () { |
---|
1416 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_summary.xml'); |
---|
1417 | try { |
---|
1418 | $feed = new XML_Feed_Parser($content); |
---|
1419 | } catch (XML_Feed_Parser_Exception $e) { |
---|
1420 | $this->assertTrue(false); |
---|
1421 | return; |
---|
1422 | } |
---|
1423 | $this->assertEquals('Example Atom', $feed->getEntryByOffset(0)->summary); |
---|
1424 | } |
---|
1425 | |
---|
1426 | function test_entry_summary_base64_1 () { |
---|
1427 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_summary_base64.xml'); |
---|
1428 | try { |
---|
1429 | $feed = new XML_Feed_Parser($content); |
---|
1430 | } catch (XML_Feed_Parser_Exception $e) { |
---|
1431 | $this->assertTrue(false); |
---|
1432 | return; |
---|
1433 | } |
---|
1434 | $this->assertEquals('Example <b>Atom</b>', $feed->getEntryByOffset(0)->summary); |
---|
1435 | } |
---|
1436 | |
---|
1437 | function test_entry_summary_base64_2_1 () { |
---|
1438 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_summary_base64_2.xml'); |
---|
1439 | try { |
---|
1440 | $feed = new XML_Feed_Parser($content); |
---|
1441 | } catch (XML_Feed_Parser_Exception $e) { |
---|
1442 | $this->assertTrue(false); |
---|
1443 | return; |
---|
1444 | } |
---|
1445 | $this->assertEquals('<p>History of the <blink> tag</p>', $feed->getEntryByOffset(0)->summary); |
---|
1446 | } |
---|
1447 | |
---|
1448 | function test_entry_summary_content_value_1 () { |
---|
1449 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_summary_content_value.xml'); |
---|
1450 | try { |
---|
1451 | $feed = new XML_Feed_Parser($content); |
---|
1452 | } catch (XML_Feed_Parser_Exception $e) { |
---|
1453 | $this->assertTrue(false); |
---|
1454 | return; |
---|
1455 | } |
---|
1456 | $this->assertEquals('Example Atom', $feed->getEntryByOffset(0)->summary); |
---|
1457 | } |
---|
1458 | |
---|
1459 | function test_entry_summary_escaped_markup_1 () { |
---|
1460 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_summary_escaped_markup.xml'); |
---|
1461 | try { |
---|
1462 | $feed = new XML_Feed_Parser($content); |
---|
1463 | } catch (XML_Feed_Parser_Exception $e) { |
---|
1464 | $this->assertTrue(false); |
---|
1465 | return; |
---|
1466 | } |
---|
1467 | $this->assertEquals('Example <b>Atom</b>', $feed->getEntryByOffset(0)->summary); |
---|
1468 | } |
---|
1469 | |
---|
1470 | function test_entry_summary_inline_markup_1 () { |
---|
1471 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_summary_inline_markup.xml'); |
---|
1472 | try { |
---|
1473 | $feed = new XML_Feed_Parser($content); |
---|
1474 | } catch (XML_Feed_Parser_Exception $e) { |
---|
1475 | $this->assertTrue(false); |
---|
1476 | return; |
---|
1477 | } |
---|
1478 | $this->assertEquals('<div>Example <b>Atom</b></div>', $feed->getEntryByOffset(0)->summary); |
---|
1479 | } |
---|
1480 | |
---|
1481 | function test_entry_summary_inline_markup_2_1 () { |
---|
1482 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_summary_inline_markup_2.xml'); |
---|
1483 | try { |
---|
1484 | $feed = new XML_Feed_Parser($content); |
---|
1485 | } catch (XML_Feed_Parser_Exception $e) { |
---|
1486 | $this->assertTrue(false); |
---|
1487 | return; |
---|
1488 | } |
---|
1489 | $this->assertEquals('<div>History of the <blink> tag</div>', $feed->getEntryByOffset(0)->summary); |
---|
1490 | } |
---|
1491 | |
---|
1492 | function test_entry_summary_text_plain_1 () { |
---|
1493 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_summary_text_plain.xml'); |
---|
1494 | try { |
---|
1495 | $feed = new XML_Feed_Parser($content); |
---|
1496 | } catch (XML_Feed_Parser_Exception $e) { |
---|
1497 | $this->assertTrue(false); |
---|
1498 | return; |
---|
1499 | } |
---|
1500 | $this->assertEquals('Example Atom', $feed->getEntryByOffset(0)->summary); |
---|
1501 | } |
---|
1502 | |
---|
1503 | function test_entry_summary_type_default_1 () { |
---|
1504 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_summary_type_default.xml'); |
---|
1505 | try { |
---|
1506 | $feed = new XML_Feed_Parser($content); |
---|
1507 | } catch (XML_Feed_Parser_Exception $e) { |
---|
1508 | $this->assertTrue(false); |
---|
1509 | return; |
---|
1510 | } |
---|
1511 | $this->assertEquals('text/plain', $feed->getEntryByOffset(0)->summary(0, 'type')); |
---|
1512 | } |
---|
1513 | |
---|
1514 | function test_entry_summary_type_text_1 () { |
---|
1515 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_summary_type_text.xml'); |
---|
1516 | try { |
---|
1517 | $feed = new XML_Feed_Parser($content); |
---|
1518 | } catch (XML_Feed_Parser_Exception $e) { |
---|
1519 | $this->assertTrue(false); |
---|
1520 | return; |
---|
1521 | } |
---|
1522 | $this->assertEquals('text/plain', $feed->getEntryByOffset(0)->summary(0, 'type')); |
---|
1523 | } |
---|
1524 | |
---|
1525 | function test_entry_title_1 () { |
---|
1526 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_title.xml'); |
---|
1527 | try { |
---|
1528 | $feed = new XML_Feed_Parser($content); |
---|
1529 | } catch (XML_Feed_Parser_Exception $e) { |
---|
1530 | $this->assertTrue(false); |
---|
1531 | return; |
---|
1532 | } |
---|
1533 | $this->assertEquals('Example Atom', $feed->getEntryByOffset(0)->title); |
---|
1534 | } |
---|
1535 | |
---|
1536 | function test_entry_title_base64_1 () { |
---|
1537 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_title_base64.xml'); |
---|
1538 | try { |
---|
1539 | $feed = new XML_Feed_Parser($content); |
---|
1540 | } catch (XML_Feed_Parser_Exception $e) { |
---|
1541 | $this->assertTrue(false); |
---|
1542 | return; |
---|
1543 | } |
---|
1544 | $this->assertEquals('Example <b>Atom</b>', $feed->getEntryByOffset(0)->title); |
---|
1545 | } |
---|
1546 | |
---|
1547 | function test_entry_title_base64_2_1 () { |
---|
1548 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_title_base64_2.xml'); |
---|
1549 | try { |
---|
1550 | $feed = new XML_Feed_Parser($content); |
---|
1551 | } catch (XML_Feed_Parser_Exception $e) { |
---|
1552 | $this->assertTrue(false); |
---|
1553 | return; |
---|
1554 | } |
---|
1555 | $this->assertEquals('<p>History of the <blink> tag</p>', $feed->getEntryByOffset(0)->title); |
---|
1556 | } |
---|
1557 | |
---|
1558 | function test_entry_title_content_value_1 () { |
---|
1559 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_title_content_value.xml'); |
---|
1560 | try { |
---|
1561 | $feed = new XML_Feed_Parser($content); |
---|
1562 | } catch (XML_Feed_Parser_Exception $e) { |
---|
1563 | $this->assertTrue(false); |
---|
1564 | return; |
---|
1565 | } |
---|
1566 | $this->assertEquals('Example Atom', $feed->getEntryByOffset(0)->title); |
---|
1567 | } |
---|
1568 | |
---|
1569 | function test_entry_title_escaped_markup_1 () { |
---|
1570 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_title_escaped_markup.xml'); |
---|
1571 | try { |
---|
1572 | $feed = new XML_Feed_Parser($content); |
---|
1573 | } catch (XML_Feed_Parser_Exception $e) { |
---|
1574 | $this->assertTrue(false); |
---|
1575 | return; |
---|
1576 | } |
---|
1577 | $this->assertEquals('Example <b>Atom</b>', $feed->getEntryByOffset(0)->title); |
---|
1578 | } |
---|
1579 | |
---|
1580 | function test_entry_title_inline_markup_1 () { |
---|
1581 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_title_inline_markup.xml'); |
---|
1582 | try { |
---|
1583 | $feed = new XML_Feed_Parser($content); |
---|
1584 | } catch (XML_Feed_Parser_Exception $e) { |
---|
1585 | $this->assertTrue(false); |
---|
1586 | return; |
---|
1587 | } |
---|
1588 | $this->assertEquals('<div>Example <b>Atom</b></div>', $feed->getEntryByOffset(0)->title); |
---|
1589 | } |
---|
1590 | |
---|
1591 | function test_entry_title_inline_markup_2_1 () { |
---|
1592 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_title_inline_markup_2.xml'); |
---|
1593 | try { |
---|
1594 | $feed = new XML_Feed_Parser($content); |
---|
1595 | } catch (XML_Feed_Parser_Exception $e) { |
---|
1596 | $this->assertTrue(false); |
---|
1597 | return; |
---|
1598 | } |
---|
1599 | $this->assertEquals('<div>History of the <blink> tag</div>', $feed->getEntryByOffset(0)->title); |
---|
1600 | } |
---|
1601 | |
---|
1602 | function test_entry_title_text_plain_1 () { |
---|
1603 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_title_text_plain.xml'); |
---|
1604 | try { |
---|
1605 | $feed = new XML_Feed_Parser($content); |
---|
1606 | } catch (XML_Feed_Parser_Exception $e) { |
---|
1607 | $this->assertTrue(false); |
---|
1608 | return; |
---|
1609 | } |
---|
1610 | $this->assertEquals('Example Atom', $feed->getEntryByOffset(0)->title); |
---|
1611 | } |
---|
1612 | |
---|
1613 | function test_entry_title_text_plain_brackets_1 () { |
---|
1614 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_title_text_plain_brackets.xml'); |
---|
1615 | try { |
---|
1616 | $feed = new XML_Feed_Parser($content); |
---|
1617 | } catch (XML_Feed_Parser_Exception $e) { |
---|
1618 | $this->assertTrue(false); |
---|
1619 | return; |
---|
1620 | } |
---|
1621 | $this->assertEquals('History of the <blink> tag', $feed->getEntryByOffset(0)->title); |
---|
1622 | } |
---|
1623 | |
---|
1624 | function test_entry_title_type_default_1 () { |
---|
1625 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_title_type_default.xml'); |
---|
1626 | try { |
---|
1627 | $feed = new XML_Feed_Parser($content); |
---|
1628 | } catch (XML_Feed_Parser_Exception $e) { |
---|
1629 | $this->assertTrue(false); |
---|
1630 | return; |
---|
1631 | } |
---|
1632 | $this->assertEquals('text/plain', $feed->getEntryByOffset(0)->title(0, 'type')); |
---|
1633 | } |
---|
1634 | |
---|
1635 | function test_entry_title_type_text_1 () { |
---|
1636 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_title_type_text.xml'); |
---|
1637 | try { |
---|
1638 | $feed = new XML_Feed_Parser($content); |
---|
1639 | } catch (XML_Feed_Parser_Exception $e) { |
---|
1640 | $this->assertTrue(false); |
---|
1641 | return; |
---|
1642 | } |
---|
1643 | $this->assertEquals('text/plain', $feed->getEntryByOffset(0)->title(0, 'type')); |
---|
1644 | } |
---|
1645 | |
---|
1646 | function test_feed_author_email_1 () { |
---|
1647 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/feed_author_email.xml'); |
---|
1648 | try { |
---|
1649 | $feed = new XML_Feed_Parser($content); |
---|
1650 | } catch (XML_Feed_Parser_Exception $e) { |
---|
1651 | $this->assertTrue(false); |
---|
1652 | return; |
---|
1653 | } |
---|
1654 | $this->assertEquals('me@example.com', $feed->author(0, 'email')); |
---|
1655 | } |
---|
1656 | |
---|
1657 | function test_feed_author_map_author_1 () { |
---|
1658 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/feed_author_map_author.xml'); |
---|
1659 | try { |
---|
1660 | $feed = new XML_Feed_Parser($content); |
---|
1661 | } catch (XML_Feed_Parser_Exception $e) { |
---|
1662 | $this->assertTrue(false); |
---|
1663 | return; |
---|
1664 | } |
---|
1665 | $this->assertEquals('Example author (me@example.com)', $feed->author); |
---|
1666 | } |
---|
1667 | |
---|
1668 | function test_feed_author_map_author_2_1 () { |
---|
1669 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/feed_author_map_author_2.xml'); |
---|
1670 | try { |
---|
1671 | $feed = new XML_Feed_Parser($content); |
---|
1672 | } catch (XML_Feed_Parser_Exception $e) { |
---|
1673 | $this->assertTrue(false); |
---|
1674 | return; |
---|
1675 | } |
---|
1676 | $this->assertEquals('Example author', $feed->author); |
---|
1677 | } |
---|
1678 | |
---|
1679 | function test_feed_author_name_1 () { |
---|
1680 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/feed_author_name.xml'); |
---|
1681 | try { |
---|
1682 | $feed = new XML_Feed_Parser($content); |
---|
1683 | } catch (XML_Feed_Parser_Exception $e) { |
---|
1684 | $this->assertTrue(false); |
---|
1685 | return; |
---|
1686 | } |
---|
1687 | $this->assertEquals('Example author', $feed->author(0, 'name')); |
---|
1688 | } |
---|
1689 | |
---|
1690 | function test_feed_author_uri_1 () { |
---|
1691 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/feed_author_uri.xml'); |
---|
1692 | try { |
---|
1693 | $feed = new XML_Feed_Parser($content); |
---|
1694 | } catch (XML_Feed_Parser_Exception $e) { |
---|
1695 | $this->assertTrue(false); |
---|
1696 | return; |
---|
1697 | } |
---|
1698 | $this->assertEquals('http://example.com/', $feed->author(0, 'url')); |
---|
1699 | } |
---|
1700 | |
---|
1701 | function test_feed_author_url_1 () { |
---|
1702 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/feed_author_url.xml'); |
---|
1703 | try { |
---|
1704 | $feed = new XML_Feed_Parser($content); |
---|
1705 | } catch (XML_Feed_Parser_Exception $e) { |
---|
1706 | $this->assertTrue(false); |
---|
1707 | return; |
---|
1708 | } |
---|
1709 | $this->assertEquals('http://example.com/', $feed->author(0, 'url')); |
---|
1710 | } |
---|
1711 | |
---|
1712 | function test_feed_contributor_email_1 () { |
---|
1713 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/feed_contributor_email.xml'); |
---|
1714 | try { |
---|
1715 | $feed = new XML_Feed_Parser($content); |
---|
1716 | } catch (XML_Feed_Parser_Exception $e) { |
---|
1717 | $this->assertTrue(false); |
---|
1718 | return; |
---|
1719 | } |
---|
1720 | $this->assertEquals('me@example.com', $feed->contributors(0, 'email')); |
---|
1721 | } |
---|
1722 | |
---|
1723 | function test_feed_contributor_multiple_1 () { |
---|
1724 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/feed_contributor_multiple.xml'); |
---|
1725 | try { |
---|
1726 | $feed = new XML_Feed_Parser($content); |
---|
1727 | } catch (XML_Feed_Parser_Exception $e) { |
---|
1728 | $this->assertTrue(false); |
---|
1729 | return; |
---|
1730 | } |
---|
1731 | $this->assertEquals(array(array('name' => 'Contributor 1', 'email' => 'me@example.com', 'href' => 'http://example.com/'), array('name' => 'Contributor 2', 'email' => 'you@example.com', 'href' => 'http://two.example.com/')), $feed->contributors); |
---|
1732 | } |
---|
1733 | |
---|
1734 | function test_feed_contributor_name_1 () { |
---|
1735 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/feed_contributor_name.xml'); |
---|
1736 | try { |
---|
1737 | $feed = new XML_Feed_Parser($content); |
---|
1738 | } catch (XML_Feed_Parser_Exception $e) { |
---|
1739 | $this->assertTrue(false); |
---|
1740 | return; |
---|
1741 | } |
---|
1742 | $this->assertEquals('Example contributor', $feed->contributors(0, 'name')); |
---|
1743 | } |
---|
1744 | |
---|
1745 | function test_feed_contributor_uri_1 () { |
---|
1746 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/feed_contributor_uri.xml'); |
---|
1747 | try { |
---|
1748 | $feed = new XML_Feed_Parser($content); |
---|
1749 | } catch (XML_Feed_Parser_Exception $e) { |
---|
1750 | $this->assertTrue(false); |
---|
1751 | return; |
---|
1752 | } |
---|
1753 | $this->assertEquals('http://example.com/', $feed->contributors(0, 'url')); |
---|
1754 | } |
---|
1755 | |
---|
1756 | function test_feed_contributor_url_1 () { |
---|
1757 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/feed_contributor_url.xml'); |
---|
1758 | try { |
---|
1759 | $feed = new XML_Feed_Parser($content); |
---|
1760 | } catch (XML_Feed_Parser_Exception $e) { |
---|
1761 | $this->assertTrue(false); |
---|
1762 | return; |
---|
1763 | } |
---|
1764 | $this->assertEquals('http://example.com/', $feed->contributors(0, 'url')); |
---|
1765 | } |
---|
1766 | |
---|
1767 | function test_feed_generator_1 () { |
---|
1768 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/feed_generator.xml'); |
---|
1769 | try { |
---|
1770 | $feed = new XML_Feed_Parser($content); |
---|
1771 | } catch (XML_Feed_Parser_Exception $e) { |
---|
1772 | $this->assertTrue(false); |
---|
1773 | return; |
---|
1774 | } |
---|
1775 | $this->assertEquals('Example generator', $feed->generator); |
---|
1776 | } |
---|
1777 | |
---|
1778 | function test_feed_generator_name_1 () { |
---|
1779 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/feed_generator_name.xml'); |
---|
1780 | try { |
---|
1781 | $feed = new XML_Feed_Parser($content); |
---|
1782 | } catch (XML_Feed_Parser_Exception $e) { |
---|
1783 | $this->assertTrue(false); |
---|
1784 | return; |
---|
1785 | } |
---|
1786 | $this->assertEquals('Example generator', $feed->generator(0, 'name')); |
---|
1787 | } |
---|
1788 | |
---|
1789 | function test_feed_generator_url_1 () { |
---|
1790 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/feed_generator_url.xml'); |
---|
1791 | try { |
---|
1792 | $feed = new XML_Feed_Parser($content); |
---|
1793 | } catch (XML_Feed_Parser_Exception $e) { |
---|
1794 | $this->assertTrue(false); |
---|
1795 | return; |
---|
1796 | } |
---|
1797 | $this->assertEquals('http://example.com/', $feed->generator(0, 'href')); |
---|
1798 | } |
---|
1799 | |
---|
1800 | function test_feed_generator_version_1 () { |
---|
1801 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/feed_generator_version.xml'); |
---|
1802 | try { |
---|
1803 | $feed = new XML_Feed_Parser($content); |
---|
1804 | } catch (XML_Feed_Parser_Exception $e) { |
---|
1805 | $this->assertTrue(false); |
---|
1806 | return; |
---|
1807 | } |
---|
1808 | $this->assertEquals('2.65', $feed->generator(0, 'version')); |
---|
1809 | } |
---|
1810 | |
---|
1811 | function test_feed_icon_1 () { |
---|
1812 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/feed_icon.xml'); |
---|
1813 | try { |
---|
1814 | $feed = new XML_Feed_Parser($content); |
---|
1815 | } catch (XML_Feed_Parser_Exception $e) { |
---|
1816 | $this->assertTrue(false); |
---|
1817 | return; |
---|
1818 | } |
---|
1819 | $this->assertEquals('http://example.com/favicon.ico', $feed->icon); |
---|
1820 | } |
---|
1821 | |
---|
1822 | function test_feed_id_1 () { |
---|
1823 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/feed_id.xml'); |
---|
1824 | try { |
---|
1825 | $feed = new XML_Feed_Parser($content); |
---|
1826 | } catch (XML_Feed_Parser_Exception $e) { |
---|
1827 | $this->assertTrue(false); |
---|
1828 | return; |
---|
1829 | } |
---|
1830 | $this->assertEquals('http://example.com/', $feed->id); |
---|
1831 | } |
---|
1832 | |
---|
1833 | function test_feed_id_map_guid_1 () { |
---|
1834 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/feed_id_map_guid.xml'); |
---|
1835 | try { |
---|
1836 | $feed = new XML_Feed_Parser($content); |
---|
1837 | } catch (XML_Feed_Parser_Exception $e) { |
---|
1838 | $this->assertTrue(false); |
---|
1839 | return; |
---|
1840 | } |
---|
1841 | $this->assertEquals('http://example.com/', $feed->guid); |
---|
1842 | } |
---|
1843 | |
---|
1844 | function test_feed_link_alternate_map_link_1 () { |
---|
1845 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/feed_link_alternate_map_link.xml'); |
---|
1846 | try { |
---|
1847 | $feed = new XML_Feed_Parser($content); |
---|
1848 | } catch (XML_Feed_Parser_Exception $e) { |
---|
1849 | $this->assertTrue(false); |
---|
1850 | return; |
---|
1851 | } |
---|
1852 | $this->assertEquals('http://www.example.com/', $feed->link); |
---|
1853 | } |
---|
1854 | |
---|
1855 | function test_feed_link_alternate_map_link_2_1 () { |
---|
1856 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/feed_link_alternate_map_link_2.xml'); |
---|
1857 | try { |
---|
1858 | $feed = new XML_Feed_Parser($content); |
---|
1859 | } catch (XML_Feed_Parser_Exception $e) { |
---|
1860 | $this->assertTrue(false); |
---|
1861 | return; |
---|
1862 | } |
---|
1863 | $this->assertEquals('http://www.example.com/', $feed->link); |
---|
1864 | } |
---|
1865 | |
---|
1866 | function test_feed_link_href_1 () { |
---|
1867 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/feed_link_href.xml'); |
---|
1868 | try { |
---|
1869 | $feed = new XML_Feed_Parser($content); |
---|
1870 | } catch (XML_Feed_Parser_Exception $e) { |
---|
1871 | $this->assertTrue(false); |
---|
1872 | return; |
---|
1873 | } |
---|
1874 | $this->assertEquals('http://www.example.com/', $feed->links(0, 'href')); |
---|
1875 | } |
---|
1876 | |
---|
1877 | function test_feed_link_hreflang_1 () { |
---|
1878 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/feed_link_hreflang.xml'); |
---|
1879 | try { |
---|
1880 | $feed = new XML_Feed_Parser($content); |
---|
1881 | } catch (XML_Feed_Parser_Exception $e) { |
---|
1882 | $this->assertTrue(false); |
---|
1883 | return; |
---|
1884 | } |
---|
1885 | $this->assertEquals('en', $feed->links(0, 'hreflang')); |
---|
1886 | } |
---|
1887 | |
---|
1888 | function test_feed_link_length_1 () { |
---|
1889 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/feed_link_length.xml'); |
---|
1890 | try { |
---|
1891 | $feed = new XML_Feed_Parser($content); |
---|
1892 | } catch (XML_Feed_Parser_Exception $e) { |
---|
1893 | $this->assertTrue(false); |
---|
1894 | return; |
---|
1895 | } |
---|
1896 | $this->assertEquals('42301', $feed->links(0, 'length')); |
---|
1897 | } |
---|
1898 | |
---|
1899 | function test_feed_link_multiple_1 () { |
---|
1900 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/feed_link_multiple.xml'); |
---|
1901 | try { |
---|
1902 | $feed = new XML_Feed_Parser($content); |
---|
1903 | } catch (XML_Feed_Parser_Exception $e) { |
---|
1904 | $this->assertTrue(false); |
---|
1905 | return; |
---|
1906 | } |
---|
1907 | $this->assertEquals(array(array('rel' => 'alternate', 'type' => 'application/xhtml+xml', 'href' => 'http://www.example.com/'), array('rel' => 'service.post', 'type' => 'application/atom+xml', 'href' => 'http://www.example.com/post')), $feed->links); |
---|
1908 | } |
---|
1909 | |
---|
1910 | function test_feed_link_no_rel_1 () { |
---|
1911 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/feed_link_no_rel.xml'); |
---|
1912 | try { |
---|
1913 | $feed = new XML_Feed_Parser($content); |
---|
1914 | } catch (XML_Feed_Parser_Exception $e) { |
---|
1915 | $this->assertTrue(false); |
---|
1916 | return; |
---|
1917 | } |
---|
1918 | $this->assertEquals('alternate', $feed->links(0, 'rel')); |
---|
1919 | } |
---|
1920 | |
---|
1921 | function test_feed_link_rel_1 () { |
---|
1922 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/feed_link_rel.xml'); |
---|
1923 | try { |
---|
1924 | $feed = new XML_Feed_Parser($content); |
---|
1925 | } catch (XML_Feed_Parser_Exception $e) { |
---|
1926 | $this->assertTrue(false); |
---|
1927 | return; |
---|
1928 | } |
---|
1929 | $this->assertEquals('alternate', $feed->links(0, 'rel')); |
---|
1930 | } |
---|
1931 | |
---|
1932 | function test_feed_link_rel_other_1 () { |
---|
1933 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/feed_link_rel_other.xml'); |
---|
1934 | try { |
---|
1935 | $feed = new XML_Feed_Parser($content); |
---|
1936 | } catch (XML_Feed_Parser_Exception $e) { |
---|
1937 | $this->assertTrue(false); |
---|
1938 | return; |
---|
1939 | } |
---|
1940 | $this->assertEquals('http://feedparser.org/rel/test', $feed->links(0, 'rel')); |
---|
1941 | } |
---|
1942 | |
---|
1943 | function test_feed_link_rel_related_1 () { |
---|
1944 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/feed_link_rel_related.xml'); |
---|
1945 | try { |
---|
1946 | $feed = new XML_Feed_Parser($content); |
---|
1947 | } catch (XML_Feed_Parser_Exception $e) { |
---|
1948 | $this->assertTrue(false); |
---|
1949 | return; |
---|
1950 | } |
---|
1951 | $this->assertEquals('related', $feed->links(0, 'rel')); |
---|
1952 | } |
---|
1953 | |
---|
1954 | function test_feed_link_rel_self_1 () { |
---|
1955 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/feed_link_rel_self.xml'); |
---|
1956 | try { |
---|
1957 | $feed = new XML_Feed_Parser($content); |
---|
1958 | } catch (XML_Feed_Parser_Exception $e) { |
---|
1959 | $this->assertTrue(false); |
---|
1960 | return; |
---|
1961 | } |
---|
1962 | $this->assertEquals('self', $feed->links(0, 'rel')); |
---|
1963 | } |
---|
1964 | |
---|
1965 | function test_feed_link_rel_via_1 () { |
---|
1966 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/feed_link_rel_via.xml'); |
---|
1967 | try { |
---|
1968 | $feed = new XML_Feed_Parser($content); |
---|
1969 | } catch (XML_Feed_Parser_Exception $e) { |
---|
1970 | $this->assertTrue(false); |
---|
1971 | return; |
---|
1972 | } |
---|
1973 | $this->assertEquals('via', $feed->links(0, 'rel')); |
---|
1974 | } |
---|
1975 | |
---|
1976 | function test_feed_link_title_1 () { |
---|
1977 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/feed_link_title.xml'); |
---|
1978 | try { |
---|
1979 | $feed = new XML_Feed_Parser($content); |
---|
1980 | } catch (XML_Feed_Parser_Exception $e) { |
---|
1981 | $this->assertTrue(false); |
---|
1982 | return; |
---|
1983 | } |
---|
1984 | $this->assertEquals('Example title', $feed->links(0, 'title')); |
---|
1985 | } |
---|
1986 | |
---|
1987 | function test_feed_link_type_1 () { |
---|
1988 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/feed_link_type.xml'); |
---|
1989 | try { |
---|
1990 | $feed = new XML_Feed_Parser($content); |
---|
1991 | } catch (XML_Feed_Parser_Exception $e) { |
---|
1992 | $this->assertTrue(false); |
---|
1993 | return; |
---|
1994 | } |
---|
1995 | $this->assertEquals('text/html', $feed->links(0, 'type')); |
---|
1996 | } |
---|
1997 | |
---|
1998 | function test_feed_logo_1 () { |
---|
1999 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/feed_logo.xml'); |
---|
2000 | try { |
---|
2001 | $feed = new XML_Feed_Parser($content); |
---|
2002 | } catch (XML_Feed_Parser_Exception $e) { |
---|
2003 | $this->assertTrue(false); |
---|
2004 | return; |
---|
2005 | } |
---|
2006 | $this->assertEquals('http://example.com/logo.jpg', $feed->logo); |
---|
2007 | } |
---|
2008 | |
---|
2009 | function test_feed_rights_1 () { |
---|
2010 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/feed_rights.xml'); |
---|
2011 | try { |
---|
2012 | $feed = new XML_Feed_Parser($content); |
---|
2013 | } catch (XML_Feed_Parser_Exception $e) { |
---|
2014 | $this->assertTrue(false); |
---|
2015 | return; |
---|
2016 | } |
---|
2017 | $this->assertEquals('Example Atom', $feed->rights); |
---|
2018 | } |
---|
2019 | |
---|
2020 | function test_feed_rights_base64_1 () { |
---|
2021 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/feed_rights_base64.xml'); |
---|
2022 | try { |
---|
2023 | $feed = new XML_Feed_Parser($content); |
---|
2024 | } catch (XML_Feed_Parser_Exception $e) { |
---|
2025 | $this->assertTrue(false); |
---|
2026 | return; |
---|
2027 | } |
---|
2028 | $this->assertEquals('Example <b>Atom</b>', $feed->rights); |
---|
2029 | } |
---|
2030 | |
---|
2031 | function test_feed_rights_base64_2_1 () { |
---|
2032 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/feed_rights_base64_2.xml'); |
---|
2033 | try { |
---|
2034 | $feed = new XML_Feed_Parser($content); |
---|
2035 | } catch (XML_Feed_Parser_Exception $e) { |
---|
2036 | $this->assertTrue(false); |
---|
2037 | return; |
---|
2038 | } |
---|
2039 | $this->assertEquals('<p>History of the <blink> tag</p>', $feed->rights); |
---|
2040 | } |
---|
2041 | |
---|
2042 | function test_feed_rights_content_type_1 () { |
---|
2043 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/feed_rights_content_type.xml'); |
---|
2044 | try { |
---|
2045 | $feed = new XML_Feed_Parser($content); |
---|
2046 | } catch (XML_Feed_Parser_Exception $e) { |
---|
2047 | $this->assertTrue(false); |
---|
2048 | return; |
---|
2049 | } |
---|
2050 | $this->assertEquals('text/plain', $feed->rights(0, 'type')); |
---|
2051 | } |
---|
2052 | |
---|
2053 | function test_feed_rights_content_type_text_1 () { |
---|
2054 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/feed_rights_content_type_text.xml'); |
---|
2055 | try { |
---|
2056 | $feed = new XML_Feed_Parser($content); |
---|
2057 | } catch (XML_Feed_Parser_Exception $e) { |
---|
2058 | $this->assertTrue(false); |
---|
2059 | return; |
---|
2060 | } |
---|
2061 | $this->assertEquals('text/plain', $feed->rights(0, 'type')); |
---|
2062 | } |
---|
2063 | |
---|
2064 | function test_feed_rights_content_value_1 () { |
---|
2065 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/feed_rights_content_value.xml'); |
---|
2066 | try { |
---|
2067 | $feed = new XML_Feed_Parser($content); |
---|
2068 | } catch (XML_Feed_Parser_Exception $e) { |
---|
2069 | $this->assertTrue(false); |
---|
2070 | return; |
---|
2071 | } |
---|
2072 | $this->assertEquals('Example Atom', $feed->rights); |
---|
2073 | } |
---|
2074 | |
---|
2075 | function test_feed_rights_escaped_markup_1 () { |
---|
2076 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/feed_rights_escaped_markup.xml'); |
---|
2077 | try { |
---|
2078 | $feed = new XML_Feed_Parser($content); |
---|
2079 | } catch (XML_Feed_Parser_Exception $e) { |
---|
2080 | $this->assertTrue(false); |
---|
2081 | return; |
---|
2082 | } |
---|
2083 | $this->assertEquals('Example <b>Atom</b>', $feed->rights); |
---|
2084 | } |
---|
2085 | |
---|
2086 | function test_feed_rights_inline_markup_1 () { |
---|
2087 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/feed_rights_inline_markup.xml'); |
---|
2088 | try { |
---|
2089 | $feed = new XML_Feed_Parser($content); |
---|
2090 | } catch (XML_Feed_Parser_Exception $e) { |
---|
2091 | $this->assertTrue(false); |
---|
2092 | return; |
---|
2093 | } |
---|
2094 | $this->assertEquals('<div>Example <b>Atom</b></div>', $feed->rights); |
---|
2095 | } |
---|
2096 | |
---|
2097 | function test_feed_rights_inline_markup_2_1 () { |
---|
2098 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/feed_rights_inline_markup_2.xml'); |
---|
2099 | try { |
---|
2100 | $feed = new XML_Feed_Parser($content); |
---|
2101 | } catch (XML_Feed_Parser_Exception $e) { |
---|
2102 | $this->assertTrue(false); |
---|
2103 | return; |
---|
2104 | } |
---|
2105 | $this->assertEquals('<div>History of the <blink> tag</div>', $feed->rights); |
---|
2106 | } |
---|
2107 | |
---|
2108 | function test_feed_rights_text_plain_1 () { |
---|
2109 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/feed_rights_text_plain.xml'); |
---|
2110 | try { |
---|
2111 | $feed = new XML_Feed_Parser($content); |
---|
2112 | } catch (XML_Feed_Parser_Exception $e) { |
---|
2113 | $this->assertTrue(false); |
---|
2114 | return; |
---|
2115 | } |
---|
2116 | $this->assertEquals('Example Atom', $feed->rights); |
---|
2117 | } |
---|
2118 | |
---|
2119 | function test_feed_subtitle_1 () { |
---|
2120 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/feed_subtitle.xml'); |
---|
2121 | try { |
---|
2122 | $feed = new XML_Feed_Parser($content); |
---|
2123 | } catch (XML_Feed_Parser_Exception $e) { |
---|
2124 | $this->assertTrue(false); |
---|
2125 | return; |
---|
2126 | } |
---|
2127 | $this->assertEquals('Example Atom', $feed->subtitle); |
---|
2128 | } |
---|
2129 | |
---|
2130 | function test_feed_subtitle_base64_1 () { |
---|
2131 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/feed_subtitle_base64.xml'); |
---|
2132 | try { |
---|
2133 | $feed = new XML_Feed_Parser($content); |
---|
2134 | } catch (XML_Feed_Parser_Exception $e) { |
---|
2135 | $this->assertTrue(false); |
---|
2136 | return; |
---|
2137 | } |
---|
2138 | $this->assertEquals('Example <b>Atom</b>', $feed->subtitle); |
---|
2139 | } |
---|
2140 | |
---|
2141 | function test_feed_subtitle_base64_2_1 () { |
---|
2142 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/feed_subtitle_base64_2.xml'); |
---|
2143 | try { |
---|
2144 | $feed = new XML_Feed_Parser($content); |
---|
2145 | } catch (XML_Feed_Parser_Exception $e) { |
---|
2146 | $this->assertTrue(false); |
---|
2147 | return; |
---|
2148 | } |
---|
2149 | $this->assertEquals('<p>History of the <blink> tag</p>', $feed->subtitle); |
---|
2150 | } |
---|
2151 | |
---|
2152 | function test_feed_subtitle_content_type_1 () { |
---|
2153 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/feed_subtitle_content_type.xml'); |
---|
2154 | try { |
---|
2155 | $feed = new XML_Feed_Parser($content); |
---|
2156 | } catch (XML_Feed_Parser_Exception $e) { |
---|
2157 | $this->assertTrue(false); |
---|
2158 | return; |
---|
2159 | } |
---|
2160 | $this->assertEquals('text/plain', $feed->subtitle(0, 'type')); |
---|
2161 | } |
---|
2162 | |
---|
2163 | function test_feed_subtitle_content_type_text_1 () { |
---|
2164 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/feed_subtitle_content_type_text.xml'); |
---|
2165 | try { |
---|
2166 | $feed = new XML_Feed_Parser($content); |
---|
2167 | } catch (XML_Feed_Parser_Exception $e) { |
---|
2168 | $this->assertTrue(false); |
---|
2169 | return; |
---|
2170 | } |
---|
2171 | $this->assertEquals('text/plain', $feed->subtitle(0, 'type')); |
---|
2172 | } |
---|
2173 | |
---|
2174 | function test_feed_subtitle_content_value_1 () { |
---|
2175 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/feed_subtitle_content_value.xml'); |
---|
2176 | try { |
---|
2177 | $feed = new XML_Feed_Parser($content); |
---|
2178 | } catch (XML_Feed_Parser_Exception $e) { |
---|
2179 | $this->assertTrue(false); |
---|
2180 | return; |
---|
2181 | } |
---|
2182 | $this->assertEquals('Example Atom', $feed->subtitle); |
---|
2183 | } |
---|
2184 | |
---|
2185 | function test_feed_subtitle_escaped_markup_1 () { |
---|
2186 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/feed_subtitle_escaped_markup.xml'); |
---|
2187 | try { |
---|
2188 | $feed = new XML_Feed_Parser($content); |
---|
2189 | } catch (XML_Feed_Parser_Exception $e) { |
---|
2190 | $this->assertTrue(false); |
---|
2191 | return; |
---|
2192 | } |
---|
2193 | $this->assertEquals('Example <b>Atom</b>', $feed->subtitle); |
---|
2194 | } |
---|
2195 | |
---|
2196 | function test_feed_subtitle_inline_markup_1 () { |
---|
2197 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/feed_subtitle_inline_markup.xml'); |
---|
2198 | try { |
---|
2199 | $feed = new XML_Feed_Parser($content); |
---|
2200 | } catch (XML_Feed_Parser_Exception $e) { |
---|
2201 | $this->assertTrue(false); |
---|
2202 | return; |
---|
2203 | } |
---|
2204 | $this->assertEquals('<div>Example <b>Atom</b></div>', $feed->subtitle); |
---|
2205 | } |
---|
2206 | |
---|
2207 | function test_feed_subtitle_inline_markup_2_1 () { |
---|
2208 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/feed_subtitle_inline_markup_2.xml'); |
---|
2209 | try { |
---|
2210 | $feed = new XML_Feed_Parser($content); |
---|
2211 | } catch (XML_Feed_Parser_Exception $e) { |
---|
2212 | $this->assertTrue(false); |
---|
2213 | return; |
---|
2214 | } |
---|
2215 | $this->assertEquals('<div>History of the <blink> tag</div>', $feed->subtitle); |
---|
2216 | } |
---|
2217 | |
---|
2218 | function test_feed_subtitle_text_plain_1 () { |
---|
2219 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/feed_subtitle_text_plain.xml'); |
---|
2220 | try { |
---|
2221 | $feed = new XML_Feed_Parser($content); |
---|
2222 | } catch (XML_Feed_Parser_Exception $e) { |
---|
2223 | $this->assertTrue(false); |
---|
2224 | return; |
---|
2225 | } |
---|
2226 | $this->assertEquals('Example Atom', $feed->subtitle); |
---|
2227 | } |
---|
2228 | |
---|
2229 | function test_feed_title_1 () { |
---|
2230 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/feed_title.xml'); |
---|
2231 | try { |
---|
2232 | $feed = new XML_Feed_Parser($content); |
---|
2233 | } catch (XML_Feed_Parser_Exception $e) { |
---|
2234 | $this->assertTrue(false); |
---|
2235 | return; |
---|
2236 | } |
---|
2237 | $this->assertEquals('Example Atom', $feed->title); |
---|
2238 | } |
---|
2239 | |
---|
2240 | function test_feed_title_base64_1 () { |
---|
2241 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/feed_title_base64.xml'); |
---|
2242 | try { |
---|
2243 | $feed = new XML_Feed_Parser($content); |
---|
2244 | } catch (XML_Feed_Parser_Exception $e) { |
---|
2245 | $this->assertTrue(false); |
---|
2246 | return; |
---|
2247 | } |
---|
2248 | $this->assertEquals('Example <b>Atom</b>', $feed->title); |
---|
2249 | } |
---|
2250 | |
---|
2251 | function test_feed_title_base64_2_1 () { |
---|
2252 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/feed_title_base64_2.xml'); |
---|
2253 | try { |
---|
2254 | $feed = new XML_Feed_Parser($content); |
---|
2255 | } catch (XML_Feed_Parser_Exception $e) { |
---|
2256 | $this->assertTrue(false); |
---|
2257 | return; |
---|
2258 | } |
---|
2259 | $this->assertEquals('<p>History of the <blink> tag</p>', $feed->title); |
---|
2260 | } |
---|
2261 | |
---|
2262 | function test_feed_title_content_type_1 () { |
---|
2263 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/feed_title_content_type.xml'); |
---|
2264 | try { |
---|
2265 | $feed = new XML_Feed_Parser($content); |
---|
2266 | } catch (XML_Feed_Parser_Exception $e) { |
---|
2267 | $this->assertTrue(false); |
---|
2268 | return; |
---|
2269 | } |
---|
2270 | $this->assertEquals('text/plain', $feed->title(0, 'type')); |
---|
2271 | } |
---|
2272 | |
---|
2273 | function test_feed_title_content_type_text_1 () { |
---|
2274 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/feed_title_content_type_text.xml'); |
---|
2275 | try { |
---|
2276 | $feed = new XML_Feed_Parser($content); |
---|
2277 | } catch (XML_Feed_Parser_Exception $e) { |
---|
2278 | $this->assertTrue(false); |
---|
2279 | return; |
---|
2280 | } |
---|
2281 | $this->assertEquals('text/plain', $feed->title(0, 'type')); |
---|
2282 | } |
---|
2283 | |
---|
2284 | function test_feed_title_content_value_1 () { |
---|
2285 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/feed_title_content_value.xml'); |
---|
2286 | try { |
---|
2287 | $feed = new XML_Feed_Parser($content); |
---|
2288 | } catch (XML_Feed_Parser_Exception $e) { |
---|
2289 | $this->assertTrue(false); |
---|
2290 | return; |
---|
2291 | } |
---|
2292 | $this->assertEquals('Example Atom', $feed->title); |
---|
2293 | } |
---|
2294 | |
---|
2295 | function test_feed_title_escaped_markup_1 () { |
---|
2296 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/feed_title_escaped_markup.xml'); |
---|
2297 | try { |
---|
2298 | $feed = new XML_Feed_Parser($content); |
---|
2299 | } catch (XML_Feed_Parser_Exception $e) { |
---|
2300 | $this->assertTrue(false); |
---|
2301 | return; |
---|
2302 | } |
---|
2303 | $this->assertEquals('Example <b>Atom</b>', $feed->title); |
---|
2304 | } |
---|
2305 | |
---|
2306 | function test_feed_title_inline_markup_1 () { |
---|
2307 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/feed_title_inline_markup.xml'); |
---|
2308 | try { |
---|
2309 | $feed = new XML_Feed_Parser($content); |
---|
2310 | } catch (XML_Feed_Parser_Exception $e) { |
---|
2311 | $this->assertTrue(false); |
---|
2312 | return; |
---|
2313 | } |
---|
2314 | $this->assertEquals('<div>Example <b>Atom</b></div>', $feed->title); |
---|
2315 | } |
---|
2316 | |
---|
2317 | function test_feed_title_inline_markup_2_1 () { |
---|
2318 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/feed_title_inline_markup_2.xml'); |
---|
2319 | try { |
---|
2320 | $feed = new XML_Feed_Parser($content); |
---|
2321 | } catch (XML_Feed_Parser_Exception $e) { |
---|
2322 | $this->assertTrue(false); |
---|
2323 | return; |
---|
2324 | } |
---|
2325 | $this->assertEquals('<div>History of the <blink> tag</div>', $feed->title); |
---|
2326 | } |
---|
2327 | |
---|
2328 | function test_feed_title_text_plain_1 () { |
---|
2329 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/feed_title_text_plain.xml'); |
---|
2330 | try { |
---|
2331 | $feed = new XML_Feed_Parser($content); |
---|
2332 | } catch (XML_Feed_Parser_Exception $e) { |
---|
2333 | $this->assertTrue(false); |
---|
2334 | return; |
---|
2335 | } |
---|
2336 | $this->assertEquals('Example Atom', $feed->title); |
---|
2337 | } |
---|
2338 | |
---|
2339 | function test_relative_uri_1 () { |
---|
2340 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/relative_uri.xml'); |
---|
2341 | try { |
---|
2342 | $feed = new XML_Feed_Parser($content); |
---|
2343 | } catch (XML_Feed_Parser_Exception $e) { |
---|
2344 | $this->assertTrue(false); |
---|
2345 | return; |
---|
2346 | } |
---|
2347 | $this->assertEquals('<div>Example <a href="http://example.com/test/test.html">test</a></div>', $feed->title); |
---|
2348 | } |
---|
2349 | |
---|
2350 | function test_relative_uri_inherit_1 () { |
---|
2351 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/relative_uri_inherit.xml'); |
---|
2352 | try { |
---|
2353 | $feed = new XML_Feed_Parser($content); |
---|
2354 | } catch (XML_Feed_Parser_Exception $e) { |
---|
2355 | $this->assertTrue(false); |
---|
2356 | return; |
---|
2357 | } |
---|
2358 | $this->assertEquals('<div>Example <a href="http://example.com/test/test.html">test</a></div>', $feed->title); |
---|
2359 | } |
---|
2360 | |
---|
2361 | function test_relative_uri_inherit_2_1 () { |
---|
2362 | $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/relative_uri_inherit_2.xml'); |
---|
2363 | try { |
---|
2364 | $feed = new XML_Feed_Parser($content); |
---|
2365 | } catch (XML_Feed_Parser_Exception $e) { |
---|
2366 | $this->assertTrue(false); |
---|
2367 | return; |
---|
2368 | } |
---|
2369 | $this->assertEquals('<div>Example <a href="http://example.com/test/test.html">test</a></div>', $feed->title); |
---|
2370 | } |
---|
2371 | } |
---|
2372 | |
---|
2373 | $suite = new PHPUnit_TestSuite('atom10_TestCase'); |
---|
2374 | $result = PHPUnit::run($suite, '123'); |
---|
2375 | echo $result->toString(); |
---|
2376 | |
---|
2377 | ?> |
---|