Subversion-Projekte lars-tiefland.php_share

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
1 lars 1
<?php
2
 
3
require_once dirname(dirname(__FILE__)) . '/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
 
10
        $feed = new XML_Feed_Parser($content);
11
 
12
        $this->assertEquals('Example Atom', $feed->title);
13
    }
14
 
15
    function test_atom10_version_1() {
16
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/atom10_version.xml');
17
 
18
        $feed = new XML_Feed_Parser($content);
19
 
20
        $this->assertEquals('atom10', $feed->version());
21
    }
22
 
23
    function test_entry_author_email_1() {
24
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_author_email.xml');
25
 
26
        $feed = new XML_Feed_Parser($content);
27
 
28
        $this->assertEquals('me@example.com', $feed->getEntryByOffset(0)->author(0, 'email'));
29
    }
30
 
31
    function test_entry_author_map_author_1() {
32
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_author_map_author.xml');
33
 
34
        $feed = new XML_Feed_Parser($content);
35
 
36
        $this->assertEquals('Example author (me@example.com)', $feed->getEntryByOffset(0)->author);
37
    }
38
 
39
    function test_entry_author_map_author_2_1() {
40
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_author_map_author_2.xml');
41
 
42
        $feed = new XML_Feed_Parser($content);
43
 
44
        $this->assertEquals('Example author', $feed->getEntryByOffset(0)->author);
45
    }
46
 
47
    function test_entry_author_name_1() {
48
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_author_name.xml');
49
 
50
        $feed = new XML_Feed_Parser($content);
51
 
52
        $this->assertEquals('Example author', $feed->getEntryByOffset(0)->author(0, 'name'));
53
    }
54
 
55
    function test_entry_author_uri_1() {
56
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_author_uri.xml');
57
 
58
        $feed = new XML_Feed_Parser($content);
59
 
60
        $this->assertEquals('http://example.com/', $feed->getEntryByOffset(0)->author(0, 'url'));
61
    }
62
 
63
    function test_entry_author_url_1() {
64
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_author_url.xml');
65
 
66
        $feed = new XML_Feed_Parser($content);
67
 
68
        $this->assertEquals('http://example.com/', $feed->getEntryByOffset(0)->author(0, 'url'));
69
    }
70
 
71
    function test_entry_category_label_1() {
72
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_category_label.xml');
73
 
74
        $feed = new XML_Feed_Parser($content);
75
 
76
        $this->assertEquals('Atom 1.0 tests', $feed->getEntryByOffset(0)->tags(0, 'label'));
77
    }
78
 
79
    function test_entry_category_scheme_1() {
80
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_category_scheme.xml');
81
 
82
        $feed = new XML_Feed_Parser($content);
83
 
84
        $this->assertEquals('http://feedparser.org/tests/', $feed->getEntryByOffset(0)->tags(0, 'scheme'));
85
    }
86
 
87
    function test_entry_category_term_1() {
88
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_category_term.xml');
89
 
90
        $feed = new XML_Feed_Parser($content);
91
 
92
        $this->assertEquals('atom10', $feed->getEntryByOffset(0)->tags(0, 'term'));
93
    }
94
 
95
    function test_entry_content_application_xml_1() {
96
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_content_application_xml.xml');
97
 
98
        $feed = new XML_Feed_Parser($content);
99
 
100
        $this->assertEquals('<div>Example <b>Atom</b></div>', $feed->getEntryByOffset(0)->content(0, 'value'));
101
    }
102
 
103
    function test_entry_content_base64_1() {
104
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_content_base64.xml');
105
 
106
        $feed = new XML_Feed_Parser($content);
107
 
108
        $this->assertEquals('Example <b>Atom</b>', $feed->getEntryByOffset(0)->content(0, 'value'));
109
    }
110
 
111
    function test_entry_content_base64_2_1() {
112
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_content_base64_2.xml');
113
 
114
        $feed = new XML_Feed_Parser($content);
115
 
116
        $this->assertEquals('<p>History of the &lt;blink&gt; tag</p>', $feed->getEntryByOffset(0)->content(0, 'value'));
117
    }
118
 
119
    function test_entry_content_escaped_markup_1() {
120
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_content_escaped_markup.xml');
121
 
122
        $feed = new XML_Feed_Parser($content);
123
 
124
        $this->assertEquals('Example <b>Atom</b>', $feed->getEntryByOffset(0)->content(0, 'value'));
125
    }
126
 
127
    function test_entry_content_inline_markup_1() {
128
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_content_inline_markup.xml');
129
 
130
        $feed = new XML_Feed_Parser($content);
131
 
132
        $this->assertEquals('<div>Example <b>Atom</b></div>', $feed->getEntryByOffset(0)->content(0, 'value'));
133
    }
134
 
135
    function test_entry_content_inline_markup_2_1() {
136
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_content_inline_markup_2.xml');
137
 
138
        $feed = new XML_Feed_Parser($content);
139
 
140
        $this->assertEquals('<div>History of the &lt;blink&gt; tag</div>', $feed->getEntryByOffset(0)->content(0, 'value'));
141
    }
142
 
143
    function test_entry_content_src_1() {
144
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_content_src.xml');
145
 
146
        $feed = new XML_Feed_Parser($content);
147
 
148
        $this->assertEquals('http://example.com/movie.mp4', $feed->getEntryByOffset(0)->content(0, 'src'));
149
    }
150
 
151
    function test_entry_content_text_plain_1() {
152
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_content_text_plain.xml');
153
 
154
        $feed = new XML_Feed_Parser($content);
155
 
156
        $this->assertEquals('Example Atom', $feed->getEntryByOffset(0)->content(0, 'value'));
157
    }
158
 
159
    function test_entry_content_text_plain_brackets_1() {
160
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_content_text_plain_brackets.xml');
161
 
162
        $feed = new XML_Feed_Parser($content);
163
 
164
        $this->assertEquals('History of the <blink> tag', $feed->getEntryByOffset(0)->content(0, 'value'));
165
    }
166
 
167
    function test_entry_content_type_1() {
168
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_content_type.xml');
169
 
170
        $feed = new XML_Feed_Parser($content);
171
 
172
        $this->assertEquals('text/plain', $feed->getEntryByOffset(0)->content(0, 'type'));
173
    }
174
 
175
    function test_entry_content_type_text_1() {
176
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_content_type_text.xml');
177
 
178
        $feed = new XML_Feed_Parser($content);
179
 
180
        $this->assertEquals('text/plain', $feed->getEntryByOffset(0)->content(0, 'type'));
181
    }
182
 
183
    function test_entry_content_value_1() {
184
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_content_value.xml');
185
 
186
        $feed = new XML_Feed_Parser($content);
187
 
188
        $this->assertEquals('Example Atom', $feed->getEntryByOffset(0)->content(0, 'value'));
189
    }
190
 
191
    function test_entry_contributor_email_1() {
192
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_contributor_email.xml');
193
 
194
        $feed = new XML_Feed_Parser($content);
195
 
196
        $this->assertEquals('me@example.com', $feed->getEntryByOffset(0)->contributors(0, 'email'));
197
    }
198
 
199
    function test_entry_contributor_multiple_1() {
200
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_contributor_multiple.xml');
201
 
202
        $feed = new XML_Feed_Parser($content);
203
 
204
        $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);
205
    }
206
 
207
    function test_entry_contributor_name_1() {
208
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_contributor_name.xml');
209
 
210
        $feed = new XML_Feed_Parser($content);
211
 
212
        $this->assertEquals('Example contributor', $feed->getEntryByOffset(0)->contributors(0, 'name'));
213
    }
214
 
215
    function test_entry_contributor_uri_1() {
216
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_contributor_uri.xml');
217
 
218
        $feed = new XML_Feed_Parser($content);
219
 
220
        $this->assertEquals('http://example.com/', $feed->getEntryByOffset(0)->contributors(0, 'url'));
221
    }
222
 
223
    function test_entry_contributor_url_1() {
224
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_contributor_url.xml');
225
 
226
        $feed = new XML_Feed_Parser($content);
227
 
228
        $this->assertEquals('http://example.com/', $feed->getEntryByOffset(0)->contributors(0, 'url'));
229
    }
230
 
231
    function test_entry_id_1() {
232
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_id.xml');
233
 
234
        $feed = new XML_Feed_Parser($content);
235
 
236
        $this->assertEquals('http://example.com/', $feed->getEntryByOffset(0)->id);
237
    }
238
 
239
    function test_entry_id_map_guid_1() {
240
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_id_map_guid.xml');
241
 
242
        $feed = new XML_Feed_Parser($content);
243
 
244
        $this->assertEquals('http://example.com/', $feed->getEntryByOffset(0)->guid);
245
    }
246
 
247
    function test_entry_id_no_normalization_1_1() {
248
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_id_no_normalization_1.xml');
249
 
250
        $feed = new XML_Feed_Parser($content);
251
 
252
        $this->assertEquals('http://www.example.org/thing', $feed->getEntryByOffset(0)->id);
253
    }
254
 
255
    function test_entry_id_no_normalization_2_1() {
256
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_id_no_normalization_2.xml');
257
 
258
        $feed = new XML_Feed_Parser($content);
259
 
260
        $this->assertEquals('http://www.example.org/Thing', $feed->getEntryByOffset(0)->id);
261
    }
262
 
263
    function test_entry_id_no_normalization_3_1() {
264
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_id_no_normalization_3.xml');
265
 
266
        $feed = new XML_Feed_Parser($content);
267
 
268
        $this->assertEquals('http://www.EXAMPLE.org/thing', $feed->getEntryByOffset(0)->id);
269
    }
270
 
271
    function test_entry_id_no_normalization_4_1() {
272
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_id_no_normalization_4.xml');
273
 
274
        $feed = new XML_Feed_Parser($content);
275
 
276
        $this->assertEquals('HTTP://www.example.org/thing', $feed->getEntryByOffset(0)->id);
277
    }
278
 
279
    function test_entry_id_no_normalization_5_1() {
280
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_id_no_normalization_5.xml');
281
 
282
        $feed = new XML_Feed_Parser($content);
283
 
284
        $this->assertEquals('http://www.example.com/~bob', $feed->getEntryByOffset(0)->id);
285
    }
286
 
287
    function test_entry_id_no_normalization_6_1() {
288
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_id_no_normalization_6.xml');
289
 
290
        $feed = new XML_Feed_Parser($content);
291
 
292
        $this->assertEquals('http://www.example.com/%7ebob', $feed->getEntryByOffset(0)->id);
293
    }
294
 
295
    function test_entry_id_no_normalization_7_1() {
296
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_id_no_normalization_7.xml');
297
 
298
        $feed = new XML_Feed_Parser($content);
299
 
300
        $this->assertEquals('http://www.example.com/%7Ebob', $feed->getEntryByOffset(0)->id);
301
    }
302
 
303
    function test_entry_link_alternate_map_link_1() {
304
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_link_alternate_map_link.xml');
305
 
306
        $feed = new XML_Feed_Parser($content);
307
 
308
        $this->assertEquals('http://www.example.com/', $feed->getEntryByOffset(0)->link);
309
    }
310
 
311
    function test_entry_link_alternate_map_link_2_1() {
312
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_link_alternate_map_link_2.xml');
313
 
314
        $feed = new XML_Feed_Parser($content);
315
 
316
        $this->assertEquals('http://www.example.com/', $feed->getEntryByOffset(0)->link);
317
    }
318
 
319
    function test_entry_link_alternate_map_link_3_1() {
320
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_link_alternate_map_link_3.xml');
321
 
322
        $feed = new XML_Feed_Parser($content);
323
 
324
        $this->assertEquals('http://www.example.com/alternate', $feed->getEntryByOffset(0)->link);
325
    }
326
 
327
    function test_entry_link_href_1() {
328
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_link_href.xml');
329
 
330
        $feed = new XML_Feed_Parser($content);
331
 
332
        $this->assertEquals('http://www.example.com/', $feed->getEntryByOffset(0)->links(0, 'href'));
333
    }
334
 
335
    function test_entry_link_hreflang_1() {
336
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_link_hreflang.xml');
337
 
338
        $feed = new XML_Feed_Parser($content);
339
 
340
        $this->assertEquals('en', $feed->getEntryByOffset(0)->links(0, 'hreflang'));
341
    }
342
 
343
    function test_entry_link_length_1() {
344
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_link_length.xml');
345
 
346
        $feed = new XML_Feed_Parser($content);
347
 
348
        $this->assertEquals('42301', $feed->getEntryByOffset(0)->links(0, 'length'));
349
    }
350
 
351
    function test_entry_link_multiple_1() {
352
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_link_multiple.xml');
353
 
354
        $feed = new XML_Feed_Parser($content);
355
 
356
        $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);
357
    }
358
 
359
    function test_entry_link_no_rel_1() {
360
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_link_no_rel.xml');
361
 
362
        $feed = new XML_Feed_Parser($content);
363
 
364
        $this->assertEquals('alternate', $feed->getEntryByOffset(0)->links(0, 'rel'));
365
    }
366
 
367
    function test_entry_link_rel_1() {
368
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_link_rel.xml');
369
 
370
        $feed = new XML_Feed_Parser($content);
371
 
372
        $this->assertEquals('alternate', $feed->getEntryByOffset(0)->links(0, 'rel'));
373
    }
374
 
375
    function test_entry_link_rel_enclosure_1() {
376
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_link_rel_enclosure.xml');
377
 
378
        $feed = new XML_Feed_Parser($content);
379
 
380
        $this->assertEquals('enclosure', $feed->getEntryByOffset(0)->links(0, 'rel'));
381
    }
382
 
383
    function test_entry_link_rel_enclosure_map_enclosure_length_1() {
384
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_link_rel_enclosure_map_enclosure_length.xml');
385
 
386
        $feed = new XML_Feed_Parser($content);
387
 
388
        $this->assertEquals('42301', $feed->getEntryByOffset(0)->enclosures(0, 'length'));
389
    }
390
 
391
    function test_entry_link_rel_enclosure_map_enclosure_type_1() {
392
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_link_rel_enclosure_map_enclosure_type.xml');
393
 
394
        $feed = new XML_Feed_Parser($content);
395
 
396
        $this->assertEquals('video/mpeg4', $feed->getEntryByOffset(0)->enclosures(0, 'type'));
397
    }
398
 
399
    function test_entry_link_rel_enclosure_map_enclosure_url_1() {
400
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_link_rel_enclosure_map_enclosure_url.xml');
401
 
402
        $feed = new XML_Feed_Parser($content);
403
 
404
        $this->assertEquals('http://www.example.com/movie.mp4', $feed->getEntryByOffset(0)->enclosures(0, 'href'));
405
    }
406
 
407
    function test_entry_link_rel_other_1() {
408
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_link_rel_other.xml');
409
 
410
        $feed = new XML_Feed_Parser($content);
411
 
412
        $this->assertEquals('http://feedparser.org/rel/test', $feed->getEntryByOffset(0)->links(0, 'rel'));
413
    }
414
 
415
    function test_entry_link_rel_related_1() {
416
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_link_rel_related.xml');
417
 
418
        $feed = new XML_Feed_Parser($content);
419
 
420
        $this->assertEquals('related', $feed->getEntryByOffset(0)->links(0, 'rel'));
421
    }
422
 
423
    function test_entry_link_rel_self_1() {
424
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_link_rel_self.xml');
425
 
426
        $feed = new XML_Feed_Parser($content);
427
 
428
        $this->assertEquals('self', $feed->getEntryByOffset(0)->links(0, 'rel'));
429
    }
430
 
431
    function test_entry_link_rel_via_1() {
432
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_link_rel_via.xml');
433
 
434
        $feed = new XML_Feed_Parser($content);
435
 
436
        $this->assertEquals('via', $feed->getEntryByOffset(0)->links(0, 'rel'));
437
    }
438
 
439
    function test_entry_link_title_1() {
440
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_link_title.xml');
441
 
442
        $feed = new XML_Feed_Parser($content);
443
 
444
        $this->assertEquals('Example title', $feed->getEntryByOffset(0)->links(0, 'title'));
445
    }
446
 
447
    function test_entry_link_type_1() {
448
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_link_type.xml');
449
 
450
        $feed = new XML_Feed_Parser($content);
451
 
452
        $this->assertEquals('text/html', $feed->getEntryByOffset(0)->links(0, 'type'));
453
    }
454
 
455
    function test_entry_rights_1() {
456
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_rights.xml');
457
 
458
        $feed = new XML_Feed_Parser($content);
459
 
460
        $this->assertEquals('Example Atom', $feed->getEntryByOffset(0)->rights);
461
    }
462
 
463
    function test_entry_rights_content_value_1() {
464
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_rights_content_value.xml');
465
 
466
        $feed = new XML_Feed_Parser($content);
467
 
468
        $this->assertEquals('Example Atom', $feed->getEntryByOffset(0)->rights);
469
    }
470
 
471
    function test_entry_rights_escaped_markup_1() {
472
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_rights_escaped_markup.xml');
473
 
474
        $feed = new XML_Feed_Parser($content);
475
 
476
        $this->assertEquals('Example <b>Atom</b>', $feed->getEntryByOffset(0)->rights);
477
    }
478
 
479
    function test_entry_rights_inline_markup_1() {
480
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_rights_inline_markup.xml');
481
 
482
        $feed = new XML_Feed_Parser($content);
483
 
484
        $this->assertEquals('<div>Example <b>Atom</b></div>', $feed->getEntryByOffset(0)->rights);
485
    }
486
 
487
    function test_entry_rights_inline_markup_2_1() {
488
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_rights_inline_markup_2.xml');
489
 
490
        $feed = new XML_Feed_Parser($content);
491
 
492
        $this->assertEquals('<div>History of the &lt;blink&gt; tag</div>', $feed->getEntryByOffset(0)->rights);
493
    }
494
 
495
    function test_entry_rights_text_plain_1() {
496
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_rights_text_plain.xml');
497
 
498
        $feed = new XML_Feed_Parser($content);
499
 
500
        $this->assertEquals('Example Atom', $feed->getEntryByOffset(0)->rights);
501
    }
502
 
503
    function test_entry_rights_text_plain_brackets_1() {
504
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_rights_text_plain_brackets.xml');
505
 
506
        $feed = new XML_Feed_Parser($content);
507
 
508
        $this->assertEquals('History of the <blink> tag', $feed->getEntryByOffset(0)->rights);
509
    }
510
 
511
    function test_entry_rights_type_default_1() {
512
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_rights_type_default.xml');
513
 
514
        $feed = new XML_Feed_Parser($content);
515
 
516
        $this->assertEquals('text/plain', $feed->getEntryByOffset(0)->rights(0, 'type'));
517
    }
518
 
519
    function test_entry_rights_type_text_1() {
520
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_rights_type_text.xml');
521
 
522
        $feed = new XML_Feed_Parser($content);
523
 
524
        $this->assertEquals('text/plain', $feed->getEntryByOffset(0)->rights(0, 'type'));
525
    }
526
 
527
    function test_entry_source_author_email_1() {
528
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_source_author_email.xml');
529
 
530
        $feed = new XML_Feed_Parser($content);
531
 
532
        $this->assertEquals('me@example.com', $feed->getEntryByOffset(0)->source(0, "author(0, 'email')"));
533
    }
534
 
535
    function test_entry_source_author_map_author_1() {
536
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_source_author_map_author.xml');
537
 
538
        $feed = new XML_Feed_Parser($content);
539
 
540
        $this->assertEquals('Example author (me@example.com)', $feed->getEntryByOffset(0)->source(0, 'author'));
541
    }
542
 
543
    function test_entry_source_author_map_author_2_1() {
544
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_source_author_map_author_2.xml');
545
 
546
        $feed = new XML_Feed_Parser($content);
547
 
548
        $this->assertEquals('Example author', $feed->getEntryByOffset(0)->source(0, 'author'));
549
    }
550
 
551
    function test_entry_source_author_name_1() {
552
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_source_author_name.xml');
553
 
554
        $feed = new XML_Feed_Parser($content);
555
 
556
        $this->assertEquals('Example author', $feed->getEntryByOffset(0)->source(0, "author(0, 'name')"));
557
    }
558
 
559
    function test_entry_source_author_uri_1() {
560
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_source_author_uri.xml');
561
 
562
        $feed = new XML_Feed_Parser($content);
563
 
564
        $this->assertEquals('http://example.com/', $feed->getEntryByOffset(0)->source(0, "author(0, 'url')"));
565
    }
566
 
567
    function test_entry_source_category_label_1() {
568
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_source_category_label.xml');
569
 
570
        $feed = new XML_Feed_Parser($content);
571
 
572
        $this->assertEquals('Atom 1.0 tests', $feed->getEntryByOffset(0)->source(0, 'tags->label'));
573
    }
574
 
575
    function test_entry_source_category_scheme_1() {
576
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_source_category_scheme.xml');
577
 
578
        $feed = new XML_Feed_Parser($content);
579
 
580
        $this->assertEquals('http://feedparser.org/tests/', $feed->getEntryByOffset(0)->source(0, 'tags->scheme'));
581
    }
582
 
583
    function test_entry_source_category_term_1() {
584
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_source_category_term.xml');
585
 
586
        $feed = new XML_Feed_Parser($content);
587
 
588
        $this->assertEquals('atom10', $feed->getEntryByOffset(0)->source(0, 'tags->term'));
589
    }
590
 
591
    function test_entry_source_contributor_email_1() {
592
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_source_contributor_email.xml');
593
 
594
        $feed = new XML_Feed_Parser($content);
595
 
596
        $this->assertEquals('me@example.com', $feed->getEntryByOffset(0)->source(0, 'contributors->email'));
597
    }
598
 
599
    function test_entry_source_contributor_multiple_1() {
600
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_source_contributor_multiple.xml');
601
 
602
        $feed = new XML_Feed_Parser($content);
603
 
604
        $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'));
605
    }
606
 
607
    function test_entry_source_contributor_name_1() {
608
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_source_contributor_name.xml');
609
 
610
        $feed = new XML_Feed_Parser($content);
611
 
612
        $this->assertEquals('Example contributor', $feed->getEntryByOffset(0)->source(0, 'contributors->name'));
613
    }
614
 
615
    function test_entry_source_contributor_uri_1() {
616
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_source_contributor_uri.xml');
617
 
618
        $feed = new XML_Feed_Parser($content);
619
 
620
        $this->assertEquals('http://example.com/', $feed->getEntryByOffset(0)->source(0, 'contributors->url'));
621
    }
622
 
623
    function test_entry_source_generator_1() {
624
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_source_generator.xml');
625
 
626
        $feed = new XML_Feed_Parser($content);
627
 
628
        $this->assertEquals('Example generator', $feed->getEntryByOffset(0)->source(0, 'generator'));
629
    }
630
 
631
    function test_entry_source_generator_name_1() {
632
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_source_generator_name.xml');
633
 
634
        $feed = new XML_Feed_Parser($content);
635
 
636
        $this->assertEquals('Example generator', $feed->getEntryByOffset(0)->source(0, "generator(0, 'name')"));
637
    }
638
 
639
    function test_entry_source_generator_uri_1() {
640
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_source_generator_uri.xml');
641
 
642
        $feed = new XML_Feed_Parser($content);
643
 
644
        $this->assertEquals('http://example.com/', $feed->getEntryByOffset(0)->source(0, "generator(0, 'href')"));
645
    }
646
 
647
    function test_entry_source_generator_version_1() {
648
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_source_generator_version.xml');
649
 
650
        $feed = new XML_Feed_Parser($content);
651
 
652
        $this->assertEquals('2.65', $feed->getEntryByOffset(0)->source(0, "generator(0, 'version')"));
653
    }
654
 
655
    function test_entry_source_icon_1() {
656
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_source_icon.xml');
657
 
658
        $feed = new XML_Feed_Parser($content);
659
 
660
        $this->assertEquals('http://example.com/favicon.ico', $feed->getEntryByOffset(0)->source(0, 'icon'));
661
    }
662
 
663
    function test_entry_source_id_1() {
664
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_source_id.xml');
665
 
666
        $feed = new XML_Feed_Parser($content);
667
 
668
        $this->assertEquals('http://example.com/', $feed->getEntryByOffset(0)->source(0, 'id'));
669
    }
670
 
671
    function test_entry_source_link_alternate_map_link_1() {
672
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_source_link_alternate_map_link.xml');
673
 
674
        $feed = new XML_Feed_Parser($content);
675
 
676
        $this->assertEquals('http://www.example.com/', $feed->getEntryByOffset(0)->source(0, 'link'));
677
    }
678
 
679
    function test_entry_source_link_alternate_map_link_2_1() {
680
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_source_link_alternate_map_link_2.xml');
681
 
682
        $feed = new XML_Feed_Parser($content);
683
 
684
        $this->assertEquals('http://www.example.com/', $feed->getEntryByOffset(0)->source(0, 'link'));
685
    }
686
 
687
    function test_entry_source_link_href_1() {
688
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_source_link_href.xml');
689
 
690
        $feed = new XML_Feed_Parser($content);
691
 
692
        $this->assertEquals('http://www.example.com/', $feed->getEntryByOffset(0)->source(0, 'links->href'));
693
    }
694
 
695
    function test_entry_source_link_hreflang_1() {
696
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_source_link_hreflang.xml');
697
 
698
        $feed = new XML_Feed_Parser($content);
699
 
700
        $this->assertEquals('en', $feed->getEntryByOffset(0)->source(0, 'links->hreflang'));
701
    }
702
 
703
    function test_entry_source_link_length_1() {
704
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_source_link_length.xml');
705
 
706
        $feed = new XML_Feed_Parser($content);
707
 
708
        $this->assertEquals('42301', $feed->getEntryByOffset(0)->source(0, 'links->length'));
709
    }
710
 
711
    function test_entry_source_link_multiple_1() {
712
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_source_link_multiple.xml');
713
 
714
        $feed = new XML_Feed_Parser($content);
715
 
716
        $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'));
717
    }
718
 
719
    function test_entry_source_link_no_rel_1() {
720
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_source_link_no_rel.xml');
721
 
722
        $feed = new XML_Feed_Parser($content);
723
 
724
        $this->assertEquals('alternate', $feed->getEntryByOffset(0)->source(0, 'links->rel'));
725
    }
726
 
727
    function test_entry_source_link_rel_1() {
728
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_source_link_rel.xml');
729
 
730
        $feed = new XML_Feed_Parser($content);
731
 
732
        $this->assertEquals('alternate', $feed->getEntryByOffset(0)->source(0, 'links->rel'));
733
    }
734
 
735
    function test_entry_source_link_rel_other_1() {
736
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_source_link_rel_other.xml');
737
 
738
        $feed = new XML_Feed_Parser($content);
739
 
740
        $this->assertEquals('http://feedparser.org/rel/test', $feed->getEntryByOffset(0)->source(0, 'links->rel'));
741
    }
742
 
743
    function test_entry_source_link_rel_related_1() {
744
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_source_link_rel_related.xml');
745
 
746
        $feed = new XML_Feed_Parser($content);
747
 
748
        $this->assertEquals('related', $feed->getEntryByOffset(0)->source(0, 'links->rel'));
749
    }
750
 
751
    function test_entry_source_link_rel_self_1() {
752
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_source_link_rel_self.xml');
753
 
754
        $feed = new XML_Feed_Parser($content);
755
 
756
        $this->assertEquals('self', $feed->getEntryByOffset(0)->source(0, 'links->rel'));
757
    }
758
 
759
    function test_entry_source_link_rel_via_1() {
760
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_source_link_rel_via.xml');
761
 
762
        $feed = new XML_Feed_Parser($content);
763
 
764
        $this->assertEquals('via', $feed->getEntryByOffset(0)->source(0, 'links->rel'));
765
    }
766
 
767
    function test_entry_source_link_title_1() {
768
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_source_link_title.xml');
769
 
770
        $feed = new XML_Feed_Parser($content);
771
 
772
        $this->assertEquals('Example title', $feed->getEntryByOffset(0)->source(0, 'links->title'));
773
    }
774
 
775
    function test_entry_source_link_type_1() {
776
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_source_link_type.xml');
777
 
778
        $feed = new XML_Feed_Parser($content);
779
 
780
        $this->assertEquals('text/html', $feed->getEntryByOffset(0)->source(0, 'links->type'));
781
    }
782
 
783
    function test_entry_source_logo_1() {
784
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_source_logo.xml');
785
 
786
        $feed = new XML_Feed_Parser($content);
787
 
788
        $this->assertEquals('http://example.com/logo.jpg', $feed->getEntryByOffset(0)->source(0, 'logo'));
789
    }
790
 
791
    function test_entry_source_rights_1() {
792
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_source_rights.xml');
793
 
794
        $feed = new XML_Feed_Parser($content);
795
 
796
        $this->assertEquals('Example Atom', $feed->getEntryByOffset(0)->source(0, 'rights'));
797
    }
798
 
799
    function test_entry_source_rights_base64_1() {
800
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_source_rights_base64.xml');
801
 
802
        $feed = new XML_Feed_Parser($content);
803
 
804
        $this->assertEquals('Example <b>Atom</b>', $feed->getEntryByOffset(0)->source(0, 'rights'));
805
    }
806
 
807
    function test_entry_source_rights_base64_2_1() {
808
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_source_rights_base64_2.xml');
809
 
810
        $feed = new XML_Feed_Parser($content);
811
 
812
        $this->assertEquals('<p>History of the &lt;blink&gt; tag</p>', $feed->getEntryByOffset(0)->source(0, 'rights'));
813
    }
814
 
815
    function test_entry_source_rights_content_type_1() {
816
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_source_rights_content_type.xml');
817
 
818
        $feed = new XML_Feed_Parser($content);
819
 
820
        $this->assertEquals('text/plain', $feed->getEntryByOffset(0)->source(0, "rights(0, 'type')"));
821
    }
822
 
823
    function test_entry_source_rights_content_type_text_1() {
824
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_source_rights_content_type_text.xml');
825
 
826
        $feed = new XML_Feed_Parser($content);
827
 
828
        $this->assertEquals('text/plain', $feed->getEntryByOffset(0)->source(0, "rights(0, 'type')"));
829
    }
830
 
831
    function test_entry_source_rights_content_value_1() {
832
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_source_rights_content_value.xml');
833
 
834
        $feed = new XML_Feed_Parser($content);
835
 
836
        $this->assertEquals('Example Atom', $feed->getEntryByOffset(0)->source(0, 'rights'));
837
    }
838
 
839
    function test_entry_source_rights_escaped_markup_1() {
840
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_source_rights_escaped_markup.xml');
841
 
842
        $feed = new XML_Feed_Parser($content);
843
 
844
        $this->assertEquals('Example <b>Atom</b>', $feed->getEntryByOffset(0)->source(0, 'rights'));
845
    }
846
 
847
    function test_entry_source_rights_inline_markup_1() {
848
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_source_rights_inline_markup.xml');
849
 
850
        $feed = new XML_Feed_Parser($content);
851
 
852
        $this->assertEquals('<div>Example <b>Atom</b></div>', $feed->getEntryByOffset(0)->source(0, 'rights'));
853
    }
854
 
855
    function test_entry_source_rights_inline_markup_2_1() {
856
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_source_rights_inline_markup_2.xml');
857
 
858
        $feed = new XML_Feed_Parser($content);
859
 
860
        $this->assertEquals('<div>History of the &lt;blink&gt; tag</div>', $feed->getEntryByOffset(0)->source(0, 'rights'));
861
    }
862
 
863
    function test_entry_source_rights_text_plain_1() {
864
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_source_rights_text_plain.xml');
865
 
866
        $feed = new XML_Feed_Parser($content);
867
 
868
        $this->assertEquals('Example Atom', $feed->getEntryByOffset(0)->source(0, 'rights'));
869
    }
870
 
871
    function test_entry_source_subittle_content_type_text_1() {
872
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_source_subittle_content_type_text.xml');
873
 
874
        $feed = new XML_Feed_Parser($content);
875
 
876
        $this->assertEquals('text/plain', $feed->getEntryByOffset(0)->source(0, "subtitle(0, 'type')"));
877
    }
878
 
879
    function test_entry_source_subtitle_1() {
880
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_source_subtitle.xml');
881
 
882
        $feed = new XML_Feed_Parser($content);
883
 
884
        $this->assertEquals('Example Atom', $feed->getEntryByOffset(0)->source(0, 'subtitle'));
885
    }
886
 
887
    function test_entry_source_subtitle_base64_1() {
888
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_source_subtitle_base64.xml');
889
 
890
        $feed = new XML_Feed_Parser($content);
891
 
892
        $this->assertEquals('Example <b>Atom</b>', $feed->getEntryByOffset(0)->source(0, 'subtitle'));
893
    }
894
 
895
    function test_entry_source_subtitle_base64_2_1() {
896
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_source_subtitle_base64_2.xml');
897
 
898
        $feed = new XML_Feed_Parser($content);
899
 
900
        $this->assertEquals('<p>History of the &lt;blink&gt; tag</p>', $feed->getEntryByOffset(0)->source(0, 'subtitle'));
901
    }
902
 
903
    function test_entry_source_subtitle_content_type_1() {
904
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_source_subtitle_content_type.xml');
905
 
906
        $feed = new XML_Feed_Parser($content);
907
 
908
        $this->assertEquals('text/plain', $feed->getEntryByOffset(0)->source(0, "subtitle(0, 'type')"));
909
    }
910
 
911
    function test_entry_source_subtitle_content_value_1() {
912
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_source_subtitle_content_value.xml');
913
 
914
        $feed = new XML_Feed_Parser($content);
915
 
916
        $this->assertEquals('Example Atom', $feed->getEntryByOffset(0)->source(0, 'subtitle'));
917
    }
918
 
919
    function test_entry_source_subtitle_escaped_markup_1() {
920
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_source_subtitle_escaped_markup.xml');
921
 
922
        $feed = new XML_Feed_Parser($content);
923
 
924
        $this->assertEquals('Example <b>Atom</b>', $feed->getEntryByOffset(0)->source(0, 'subtitle'));
925
    }
926
 
927
    function test_entry_source_subtitle_inline_markup_1() {
928
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_source_subtitle_inline_markup.xml');
929
 
930
        $feed = new XML_Feed_Parser($content);
931
 
932
        $this->assertEquals('<div>Example <b>Atom</b></div>', $feed->getEntryByOffset(0)->source(0, 'subtitle'));
933
    }
934
 
935
    function test_entry_source_subtitle_inline_markup_2_1() {
936
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_source_subtitle_inline_markup_2.xml');
937
 
938
        $feed = new XML_Feed_Parser($content);
939
 
940
        $this->assertEquals('<div>History of the &lt;blink&gt; tag</div>', $feed->getEntryByOffset(0)->source(0, 'subtitle'));
941
    }
942
 
943
    function test_entry_source_subtitle_text_plain_1() {
944
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_source_subtitle_text_plain.xml');
945
 
946
        $feed = new XML_Feed_Parser($content);
947
 
948
        $this->assertEquals('Example Atom', $feed->getEntryByOffset(0)->source(0, 'subtitle'));
949
    }
950
 
951
    function test_entry_source_title_1() {
952
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_source_title.xml');
953
 
954
        $feed = new XML_Feed_Parser($content);
955
 
956
        $this->assertEquals('Example Atom', $feed->getEntryByOffset(0)->source(0, 'title'));
957
    }
958
 
959
    function test_entry_source_title_base64_1() {
960
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_source_title_base64.xml');
961
 
962
        $feed = new XML_Feed_Parser($content);
963
 
964
        $this->assertEquals('Example <b>Atom</b>', $feed->getEntryByOffset(0)->source(0, 'title'));
965
    }
966
 
967
    function test_entry_source_title_base64_2_1() {
968
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_source_title_base64_2.xml');
969
 
970
        $feed = new XML_Feed_Parser($content);
971
 
972
        $this->assertEquals('<p>History of the &lt;blink&gt; tag</p>', $feed->getEntryByOffset(0)->source(0, 'title'));
973
    }
974
 
975
    function test_entry_source_title_content_type_1() {
976
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_source_title_content_type.xml');
977
 
978
        $feed = new XML_Feed_Parser($content);
979
 
980
        $this->assertEquals('text/plain', $feed->getEntryByOffset(0)->source(0, "title(0, 'type')"));
981
    }
982
 
983
    function test_entry_source_title_content_type_text_1() {
984
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_source_title_content_type_text.xml');
985
 
986
        $feed = new XML_Feed_Parser($content);
987
 
988
        $this->assertEquals('text/plain', $feed->getEntryByOffset(0)->source(0, "title(0, 'type')"));
989
    }
990
 
991
    function test_entry_source_title_content_value_1() {
992
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_source_title_content_value.xml');
993
 
994
        $feed = new XML_Feed_Parser($content);
995
 
996
        $this->assertEquals('Example Atom', $feed->getEntryByOffset(0)->source(0, 'title'));
997
    }
998
 
999
    function test_entry_source_title_escaped_markup_1() {
1000
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_source_title_escaped_markup.xml');
1001
 
1002
        $feed = new XML_Feed_Parser($content);
1003
 
1004
        $this->assertEquals('Example <b>Atom</b>', $feed->getEntryByOffset(0)->source(0, 'title'));
1005
    }
1006
 
1007
    function test_entry_source_title_inline_markup_1() {
1008
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_source_title_inline_markup.xml');
1009
 
1010
        $feed = new XML_Feed_Parser($content);
1011
 
1012
        $this->assertEquals('<div>Example <b>Atom</b></div>', $feed->getEntryByOffset(0)->source(0, 'title'));
1013
    }
1014
 
1015
    function test_entry_source_title_inline_markup_2_1() {
1016
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_source_title_inline_markup_2.xml');
1017
 
1018
        $feed = new XML_Feed_Parser($content);
1019
 
1020
        $this->assertEquals('<div>History of the &lt;blink&gt; tag</div>', $feed->getEntryByOffset(0)->source(0, 'title'));
1021
    }
1022
 
1023
    function test_entry_source_title_text_plain_1() {
1024
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_source_title_text_plain.xml');
1025
 
1026
        $feed = new XML_Feed_Parser($content);
1027
 
1028
        $this->assertEquals('Example Atom', $feed->getEntryByOffset(0)->source(0, 'title'));
1029
    }
1030
 
1031
    function test_entry_summary_1() {
1032
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_summary.xml');
1033
 
1034
        $feed = new XML_Feed_Parser($content);
1035
 
1036
        $this->assertEquals('Example Atom', $feed->getEntryByOffset(0)->summary);
1037
    }
1038
 
1039
    function test_entry_summary_base64_1() {
1040
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_summary_base64.xml');
1041
 
1042
        $feed = new XML_Feed_Parser($content);
1043
 
1044
        $this->assertEquals('Example <b>Atom</b>', $feed->getEntryByOffset(0)->summary);
1045
    }
1046
 
1047
    function test_entry_summary_base64_2_1() {
1048
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_summary_base64_2.xml');
1049
 
1050
        $feed = new XML_Feed_Parser($content);
1051
 
1052
        $this->assertEquals('<p>History of the &lt;blink&gt; tag</p>', $feed->getEntryByOffset(0)->summary);
1053
    }
1054
 
1055
    function test_entry_summary_content_value_1() {
1056
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_summary_content_value.xml');
1057
 
1058
        $feed = new XML_Feed_Parser($content);
1059
 
1060
        $this->assertEquals('Example Atom', $feed->getEntryByOffset(0)->summary);
1061
    }
1062
 
1063
    function test_entry_summary_escaped_markup_1() {
1064
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_summary_escaped_markup.xml');
1065
 
1066
        $feed = new XML_Feed_Parser($content);
1067
 
1068
        $this->assertEquals('Example <b>Atom</b>', $feed->getEntryByOffset(0)->summary);
1069
    }
1070
 
1071
    function test_entry_summary_inline_markup_1() {
1072
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_summary_inline_markup.xml');
1073
 
1074
        $feed = new XML_Feed_Parser($content);
1075
 
1076
        $this->assertEquals('<div>Example <b>Atom</b></div>', $feed->getEntryByOffset(0)->summary);
1077
    }
1078
 
1079
    function test_entry_summary_inline_markup_2_1() {
1080
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_summary_inline_markup_2.xml');
1081
 
1082
        $feed = new XML_Feed_Parser($content);
1083
 
1084
        $this->assertEquals('<div>History of the &lt;blink&gt; tag</div>', $feed->getEntryByOffset(0)->summary);
1085
    }
1086
 
1087
    function test_entry_summary_text_plain_1() {
1088
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_summary_text_plain.xml');
1089
 
1090
        $feed = new XML_Feed_Parser($content);
1091
 
1092
        $this->assertEquals('Example Atom', $feed->getEntryByOffset(0)->summary);
1093
    }
1094
 
1095
    function test_entry_summary_type_default_1() {
1096
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_summary_type_default.xml');
1097
 
1098
        $feed = new XML_Feed_Parser($content);
1099
 
1100
        $this->assertEquals('text/plain', $feed->getEntryByOffset(0)->summary(0, 'type'));
1101
    }
1102
 
1103
    function test_entry_summary_type_text_1() {
1104
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_summary_type_text.xml');
1105
 
1106
        $feed = new XML_Feed_Parser($content);
1107
 
1108
        $this->assertEquals('text/plain', $feed->getEntryByOffset(0)->summary(0, 'type'));
1109
    }
1110
 
1111
    function test_entry_title_1() {
1112
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_title.xml');
1113
 
1114
        $feed = new XML_Feed_Parser($content);
1115
 
1116
        $this->assertEquals('Example Atom', $feed->getEntryByOffset(0)->title);
1117
    }
1118
 
1119
    function test_entry_title_base64_1() {
1120
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_title_base64.xml');
1121
 
1122
        $feed = new XML_Feed_Parser($content);
1123
 
1124
        $this->assertEquals('Example <b>Atom</b>', $feed->getEntryByOffset(0)->title);
1125
    }
1126
 
1127
    function test_entry_title_base64_2_1() {
1128
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_title_base64_2.xml');
1129
 
1130
        $feed = new XML_Feed_Parser($content);
1131
 
1132
        $this->assertEquals('<p>History of the &lt;blink&gt; tag</p>', $feed->getEntryByOffset(0)->title);
1133
    }
1134
 
1135
    function test_entry_title_content_value_1() {
1136
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_title_content_value.xml');
1137
 
1138
        $feed = new XML_Feed_Parser($content);
1139
 
1140
        $this->assertEquals('Example Atom', $feed->getEntryByOffset(0)->title);
1141
    }
1142
 
1143
    function test_entry_title_escaped_markup_1() {
1144
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_title_escaped_markup.xml');
1145
 
1146
        $feed = new XML_Feed_Parser($content);
1147
 
1148
        $this->assertEquals('Example <b>Atom</b>', $feed->getEntryByOffset(0)->title);
1149
    }
1150
 
1151
    function test_entry_title_inline_markup_1() {
1152
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_title_inline_markup.xml');
1153
 
1154
        $feed = new XML_Feed_Parser($content);
1155
 
1156
        $this->assertEquals('<div>Example <b>Atom</b></div>', $feed->getEntryByOffset(0)->title);
1157
    }
1158
 
1159
    function test_entry_title_inline_markup_2_1() {
1160
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_title_inline_markup_2.xml');
1161
 
1162
        $feed = new XML_Feed_Parser($content);
1163
 
1164
        $this->assertEquals('<div>History of the &lt;blink&gt; tag</div>', $feed->getEntryByOffset(0)->title);
1165
    }
1166
 
1167
    function test_entry_title_text_plain_1() {
1168
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_title_text_plain.xml');
1169
 
1170
        $feed = new XML_Feed_Parser($content);
1171
 
1172
        $this->assertEquals('Example Atom', $feed->getEntryByOffset(0)->title);
1173
    }
1174
 
1175
    function test_entry_title_text_plain_brackets_1() {
1176
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_title_text_plain_brackets.xml');
1177
 
1178
        $feed = new XML_Feed_Parser($content);
1179
 
1180
        $this->assertEquals('History of the <blink> tag', $feed->getEntryByOffset(0)->title);
1181
    }
1182
 
1183
    function test_entry_title_type_default_1() {
1184
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_title_type_default.xml');
1185
 
1186
        $feed = new XML_Feed_Parser($content);
1187
 
1188
        $this->assertEquals('text/plain', $feed->getEntryByOffset(0)->title(0, 'type'));
1189
    }
1190
 
1191
    function test_entry_title_type_text_1() {
1192
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/entry_title_type_text.xml');
1193
 
1194
        $feed = new XML_Feed_Parser($content);
1195
 
1196
        $this->assertEquals('text/plain', $feed->getEntryByOffset(0)->title(0, 'type'));
1197
    }
1198
 
1199
    function test_feed_author_email_1() {
1200
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/feed_author_email.xml');
1201
 
1202
        $feed = new XML_Feed_Parser($content);
1203
 
1204
        $this->assertEquals('me@example.com', $feed->author(0, 'email'));
1205
    }
1206
 
1207
    function test_feed_author_map_author_1() {
1208
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/feed_author_map_author.xml');
1209
 
1210
        $feed = new XML_Feed_Parser($content);
1211
 
1212
        $this->assertEquals('Example author (me@example.com)', $feed->author);
1213
    }
1214
 
1215
    function test_feed_author_map_author_2_1() {
1216
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/feed_author_map_author_2.xml');
1217
 
1218
        $feed = new XML_Feed_Parser($content);
1219
 
1220
        $this->assertEquals('Example author', $feed->author);
1221
    }
1222
 
1223
    function test_feed_author_name_1() {
1224
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/feed_author_name.xml');
1225
 
1226
        $feed = new XML_Feed_Parser($content);
1227
 
1228
        $this->assertEquals('Example author', $feed->author(0, 'name'));
1229
    }
1230
 
1231
    function test_feed_author_uri_1() {
1232
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/feed_author_uri.xml');
1233
 
1234
        $feed = new XML_Feed_Parser($content);
1235
 
1236
        $this->assertEquals('http://example.com/', $feed->author(0, 'url'));
1237
    }
1238
 
1239
    function test_feed_author_url_1() {
1240
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/feed_author_url.xml');
1241
 
1242
        $feed = new XML_Feed_Parser($content);
1243
 
1244
        $this->assertEquals('http://example.com/', $feed->author(0, 'url'));
1245
    }
1246
 
1247
    function test_feed_contributor_email_1() {
1248
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/feed_contributor_email.xml');
1249
 
1250
        $feed = new XML_Feed_Parser($content);
1251
 
1252
        $this->assertEquals('me@example.com', $feed->contributors(0, 'email'));
1253
    }
1254
 
1255
    function test_feed_contributor_multiple_1() {
1256
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/feed_contributor_multiple.xml');
1257
 
1258
        $feed = new XML_Feed_Parser($content);
1259
 
1260
        $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);
1261
    }
1262
 
1263
    function test_feed_contributor_name_1() {
1264
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/feed_contributor_name.xml');
1265
 
1266
        $feed = new XML_Feed_Parser($content);
1267
 
1268
        $this->assertEquals('Example contributor', $feed->contributors(0, 'name'));
1269
    }
1270
 
1271
    function test_feed_contributor_uri_1() {
1272
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/feed_contributor_uri.xml');
1273
 
1274
        $feed = new XML_Feed_Parser($content);
1275
 
1276
        $this->assertEquals('http://example.com/', $feed->contributors(0, 'url'));
1277
    }
1278
 
1279
    function test_feed_contributor_url_1() {
1280
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/feed_contributor_url.xml');
1281
 
1282
        $feed = new XML_Feed_Parser($content);
1283
 
1284
        $this->assertEquals('http://example.com/', $feed->contributors(0, 'url'));
1285
    }
1286
 
1287
    function test_feed_generator_1() {
1288
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/feed_generator.xml');
1289
 
1290
        $feed = new XML_Feed_Parser($content);
1291
 
1292
        $this->assertEquals('Example generator', $feed->generator);
1293
    }
1294
 
1295
    function test_feed_generator_name_1() {
1296
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/feed_generator_name.xml');
1297
 
1298
        $feed = new XML_Feed_Parser($content);
1299
 
1300
        $this->assertEquals('Example generator', $feed->generator(0, 'name'));
1301
    }
1302
 
1303
    function test_feed_generator_url_1() {
1304
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/feed_generator_url.xml');
1305
 
1306
        $feed = new XML_Feed_Parser($content);
1307
 
1308
        $this->assertEquals('http://example.com/', $feed->generator(0, 'href'));
1309
    }
1310
 
1311
    function test_feed_generator_version_1() {
1312
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/feed_generator_version.xml');
1313
 
1314
        $feed = new XML_Feed_Parser($content);
1315
 
1316
        $this->assertEquals('2.65', $feed->generator(0, 'version'));
1317
    }
1318
 
1319
    function test_feed_icon_1() {
1320
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/feed_icon.xml');
1321
 
1322
        $feed = new XML_Feed_Parser($content);
1323
 
1324
        $this->assertEquals('http://example.com/favicon.ico', $feed->icon);
1325
    }
1326
 
1327
    function test_feed_id_1() {
1328
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/feed_id.xml');
1329
 
1330
        $feed = new XML_Feed_Parser($content);
1331
 
1332
        $this->assertEquals('http://example.com/', $feed->id);
1333
    }
1334
 
1335
    function test_feed_id_map_guid_1() {
1336
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/feed_id_map_guid.xml');
1337
 
1338
        $feed = new XML_Feed_Parser($content);
1339
 
1340
        $this->assertEquals('http://example.com/', $feed->guid);
1341
    }
1342
 
1343
    function test_feed_link_alternate_map_link_1() {
1344
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/feed_link_alternate_map_link.xml');
1345
 
1346
        $feed = new XML_Feed_Parser($content);
1347
 
1348
        $this->assertEquals('http://www.example.com/', $feed->link);
1349
    }
1350
 
1351
    function test_feed_link_alternate_map_link_2_1() {
1352
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/feed_link_alternate_map_link_2.xml');
1353
 
1354
        $feed = new XML_Feed_Parser($content);
1355
 
1356
        $this->assertEquals('http://www.example.com/', $feed->link);
1357
    }
1358
 
1359
    function test_feed_link_href_1() {
1360
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/feed_link_href.xml');
1361
 
1362
        $feed = new XML_Feed_Parser($content);
1363
 
1364
        $this->assertEquals('http://www.example.com/', $feed->links(0, 'href'));
1365
    }
1366
 
1367
    function test_feed_link_hreflang_1() {
1368
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/feed_link_hreflang.xml');
1369
 
1370
        $feed = new XML_Feed_Parser($content);
1371
 
1372
        $this->assertEquals('en', $feed->links(0, 'hreflang'));
1373
    }
1374
 
1375
    function test_feed_link_length_1() {
1376
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/feed_link_length.xml');
1377
 
1378
        $feed = new XML_Feed_Parser($content);
1379
 
1380
        $this->assertEquals('42301', $feed->links(0, 'length'));
1381
    }
1382
 
1383
    function test_feed_link_multiple_1() {
1384
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/feed_link_multiple.xml');
1385
 
1386
        $feed = new XML_Feed_Parser($content);
1387
 
1388
        $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);
1389
    }
1390
 
1391
    function test_feed_link_no_rel_1() {
1392
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/feed_link_no_rel.xml');
1393
 
1394
        $feed = new XML_Feed_Parser($content);
1395
 
1396
        $this->assertEquals('alternate', $feed->links(0, 'rel'));
1397
    }
1398
 
1399
    function test_feed_link_rel_1() {
1400
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/feed_link_rel.xml');
1401
 
1402
        $feed = new XML_Feed_Parser($content);
1403
 
1404
        $this->assertEquals('alternate', $feed->links(0, 'rel'));
1405
    }
1406
 
1407
    function test_feed_link_rel_other_1() {
1408
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/feed_link_rel_other.xml');
1409
 
1410
        $feed = new XML_Feed_Parser($content);
1411
 
1412
        $this->assertEquals('http://feedparser.org/rel/test', $feed->links(0, 'rel'));
1413
    }
1414
 
1415
    function test_feed_link_rel_related_1() {
1416
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/feed_link_rel_related.xml');
1417
 
1418
        $feed = new XML_Feed_Parser($content);
1419
 
1420
        $this->assertEquals('related', $feed->links(0, 'rel'));
1421
    }
1422
 
1423
    function test_feed_link_rel_self_1() {
1424
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/feed_link_rel_self.xml');
1425
 
1426
        $feed = new XML_Feed_Parser($content);
1427
 
1428
        $this->assertEquals('self', $feed->links(0, 'rel'));
1429
    }
1430
 
1431
    function test_feed_link_rel_via_1() {
1432
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/feed_link_rel_via.xml');
1433
 
1434
        $feed = new XML_Feed_Parser($content);
1435
 
1436
        $this->assertEquals('via', $feed->links(0, 'rel'));
1437
    }
1438
 
1439
    function test_feed_link_title_1() {
1440
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/feed_link_title.xml');
1441
 
1442
        $feed = new XML_Feed_Parser($content);
1443
 
1444
        $this->assertEquals('Example title', $feed->links(0, 'title'));
1445
    }
1446
 
1447
    function test_feed_link_type_1() {
1448
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/feed_link_type.xml');
1449
 
1450
        $feed = new XML_Feed_Parser($content);
1451
 
1452
        $this->assertEquals('text/html', $feed->links(0, 'type'));
1453
    }
1454
 
1455
    function test_feed_logo_1() {
1456
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/feed_logo.xml');
1457
 
1458
        $feed = new XML_Feed_Parser($content);
1459
 
1460
        $this->assertEquals('http://example.com/logo.jpg', $feed->logo);
1461
    }
1462
 
1463
    function test_feed_rights_1() {
1464
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/feed_rights.xml');
1465
 
1466
        $feed = new XML_Feed_Parser($content);
1467
 
1468
        $this->assertEquals('Example Atom', $feed->rights);
1469
    }
1470
 
1471
    function test_feed_rights_base64_1() {
1472
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/feed_rights_base64.xml');
1473
 
1474
        $feed = new XML_Feed_Parser($content);
1475
 
1476
        $this->assertEquals('Example <b>Atom</b>', $feed->rights);
1477
    }
1478
 
1479
    function test_feed_rights_base64_2_1() {
1480
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/feed_rights_base64_2.xml');
1481
 
1482
        $feed = new XML_Feed_Parser($content);
1483
 
1484
        $this->assertEquals('<p>History of the &lt;blink&gt; tag</p>', $feed->rights);
1485
    }
1486
 
1487
    function test_feed_rights_content_type_1() {
1488
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/feed_rights_content_type.xml');
1489
 
1490
        $feed = new XML_Feed_Parser($content);
1491
 
1492
        $this->assertEquals('text/plain', $feed->rights(0, 'type'));
1493
    }
1494
 
1495
    function test_feed_rights_content_type_text_1() {
1496
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/feed_rights_content_type_text.xml');
1497
 
1498
        $feed = new XML_Feed_Parser($content);
1499
 
1500
        $this->assertEquals('text/plain', $feed->rights(0, 'type'));
1501
    }
1502
 
1503
    function test_feed_rights_content_value_1() {
1504
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/feed_rights_content_value.xml');
1505
 
1506
        $feed = new XML_Feed_Parser($content);
1507
 
1508
        $this->assertEquals('Example Atom', $feed->rights);
1509
    }
1510
 
1511
    function test_feed_rights_escaped_markup_1() {
1512
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/feed_rights_escaped_markup.xml');
1513
 
1514
        $feed = new XML_Feed_Parser($content);
1515
 
1516
        $this->assertEquals('Example <b>Atom</b>', $feed->rights);
1517
    }
1518
 
1519
    function test_feed_rights_inline_markup_1() {
1520
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/feed_rights_inline_markup.xml');
1521
 
1522
        $feed = new XML_Feed_Parser($content);
1523
 
1524
        $this->assertEquals('<div>Example <b>Atom</b></div>', $feed->rights);
1525
    }
1526
 
1527
    function test_feed_rights_inline_markup_2_1() {
1528
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/feed_rights_inline_markup_2.xml');
1529
 
1530
        $feed = new XML_Feed_Parser($content);
1531
 
1532
        $this->assertEquals('<div>History of the &lt;blink&gt; tag</div>', $feed->rights);
1533
    }
1534
 
1535
    function test_feed_rights_text_plain_1() {
1536
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/feed_rights_text_plain.xml');
1537
 
1538
        $feed = new XML_Feed_Parser($content);
1539
 
1540
        $this->assertEquals('Example Atom', $feed->rights);
1541
    }
1542
 
1543
    function test_feed_subtitle_1() {
1544
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/feed_subtitle.xml');
1545
 
1546
        $feed = new XML_Feed_Parser($content);
1547
 
1548
        $this->assertEquals('Example Atom', $feed->subtitle);
1549
    }
1550
 
1551
    function test_feed_subtitle_base64_1() {
1552
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/feed_subtitle_base64.xml');
1553
 
1554
        $feed = new XML_Feed_Parser($content);
1555
 
1556
        $this->assertEquals('Example <b>Atom</b>', $feed->subtitle);
1557
    }
1558
 
1559
    function test_feed_subtitle_base64_2_1() {
1560
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/feed_subtitle_base64_2.xml');
1561
 
1562
        $feed = new XML_Feed_Parser($content);
1563
 
1564
        $this->assertEquals('<p>History of the &lt;blink&gt; tag</p>', $feed->subtitle);
1565
    }
1566
 
1567
    function test_feed_subtitle_content_type_1() {
1568
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/feed_subtitle_content_type.xml');
1569
 
1570
        $feed = new XML_Feed_Parser($content);
1571
 
1572
        $this->assertEquals('text/plain', $feed->subtitle(0, 'type'));
1573
    }
1574
 
1575
    function test_feed_subtitle_content_type_text_1() {
1576
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/feed_subtitle_content_type_text.xml');
1577
 
1578
        $feed = new XML_Feed_Parser($content);
1579
 
1580
        $this->assertEquals('text/plain', $feed->subtitle(0, 'type'));
1581
    }
1582
 
1583
    function test_feed_subtitle_content_value_1() {
1584
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/feed_subtitle_content_value.xml');
1585
 
1586
        $feed = new XML_Feed_Parser($content);
1587
 
1588
        $this->assertEquals('Example Atom', $feed->subtitle);
1589
    }
1590
 
1591
    function test_feed_subtitle_escaped_markup_1() {
1592
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/feed_subtitle_escaped_markup.xml');
1593
 
1594
        $feed = new XML_Feed_Parser($content);
1595
 
1596
        $this->assertEquals('Example <b>Atom</b>', $feed->subtitle);
1597
    }
1598
 
1599
    function test_feed_subtitle_inline_markup_1() {
1600
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/feed_subtitle_inline_markup.xml');
1601
 
1602
        $feed = new XML_Feed_Parser($content);
1603
 
1604
        $this->assertEquals('<div>Example <b>Atom</b></div>', $feed->subtitle);
1605
    }
1606
 
1607
    function test_feed_subtitle_inline_markup_2_1() {
1608
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/feed_subtitle_inline_markup_2.xml');
1609
 
1610
        $feed = new XML_Feed_Parser($content);
1611
 
1612
        $this->assertEquals('<div>History of the &lt;blink&gt; tag</div>', $feed->subtitle);
1613
    }
1614
 
1615
    function test_feed_subtitle_text_plain_1() {
1616
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/feed_subtitle_text_plain.xml');
1617
 
1618
        $feed = new XML_Feed_Parser($content);
1619
 
1620
        $this->assertEquals('Example Atom', $feed->subtitle);
1621
    }
1622
 
1623
    function test_feed_title_1() {
1624
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/feed_title.xml');
1625
 
1626
        $feed = new XML_Feed_Parser($content);
1627
 
1628
        $this->assertEquals('Example Atom', $feed->title);
1629
    }
1630
 
1631
    function test_feed_title_base64_1() {
1632
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/feed_title_base64.xml');
1633
 
1634
        $feed = new XML_Feed_Parser($content);
1635
 
1636
        $this->assertEquals('Example <b>Atom</b>', $feed->title);
1637
    }
1638
 
1639
    function test_feed_title_base64_2_1() {
1640
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/feed_title_base64_2.xml');
1641
 
1642
        $feed = new XML_Feed_Parser($content);
1643
 
1644
        $this->assertEquals('<p>History of the &lt;blink&gt; tag</p>', $feed->title);
1645
    }
1646
 
1647
    function test_feed_title_content_type_1() {
1648
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/feed_title_content_type.xml');
1649
 
1650
        $feed = new XML_Feed_Parser($content);
1651
 
1652
        $this->assertEquals('text/plain', $feed->title(0, 'type'));
1653
    }
1654
 
1655
    function test_feed_title_content_type_text_1() {
1656
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/feed_title_content_type_text.xml');
1657
 
1658
        $feed = new XML_Feed_Parser($content);
1659
 
1660
        $this->assertEquals('text/plain', $feed->title(0, 'type'));
1661
    }
1662
 
1663
    function test_feed_title_content_value_1() {
1664
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/feed_title_content_value.xml');
1665
 
1666
        $feed = new XML_Feed_Parser($content);
1667
 
1668
        $this->assertEquals('Example Atom', $feed->title);
1669
    }
1670
 
1671
    function test_feed_title_escaped_markup_1() {
1672
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/feed_title_escaped_markup.xml');
1673
 
1674
        $feed = new XML_Feed_Parser($content);
1675
 
1676
        $this->assertEquals('Example <b>Atom</b>', $feed->title);
1677
    }
1678
 
1679
    function test_feed_title_inline_markup_1() {
1680
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/feed_title_inline_markup.xml');
1681
 
1682
        $feed = new XML_Feed_Parser($content);
1683
 
1684
        $this->assertEquals('<div>Example <b>Atom</b></div>', $feed->title);
1685
    }
1686
 
1687
    function test_feed_title_inline_markup_2_1() {
1688
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/feed_title_inline_markup_2.xml');
1689
 
1690
        $feed = new XML_Feed_Parser($content);
1691
 
1692
        $this->assertEquals('<div>History of the &lt;blink&gt; tag</div>', $feed->title);
1693
    }
1694
 
1695
    function test_feed_title_text_plain_1() {
1696
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/feed_title_text_plain.xml');
1697
 
1698
        $feed = new XML_Feed_Parser($content);
1699
 
1700
        $this->assertEquals('Example Atom', $feed->title);
1701
    }
1702
 
1703
    function test_relative_uri_1() {
1704
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/relative_uri.xml');
1705
 
1706
        $feed = new XML_Feed_Parser($content);
1707
 
1708
        $this->assertEquals('<div>Example <a href="http://example.com/test/test.html">test</a></div>', $feed->title);
1709
    }
1710
 
1711
    function test_relative_uri_inherit_1() {
1712
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/relative_uri_inherit.xml');
1713
 
1714
        $feed = new XML_Feed_Parser($content);
1715
 
1716
        $this->assertEquals('<div>Example <a href="http://example.com/test/test.html">test</a></div>', $feed->title);
1717
    }
1718
 
1719
    function test_relative_uri_inherit_2_1() {
1720
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/atom10/relative_uri_inherit_2.xml');
1721
 
1722
        $feed = new XML_Feed_Parser($content);
1723
 
1724
        $this->assertEquals('<div>Example <a href="http://example.com/test/test.html">test</a></div>', $feed->title);
1725
    }
1726
 
1727
}
1728
?>