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 rss_TestCase extends XML_Feed_Parser_Converted_TestCase {
6
 
7
    function test_channel_author_1() {
8
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/rss/channel_author.xml');
9
 
10
        $feed = new XML_Feed_Parser($content);
11
 
12
        $this->assertEquals('Example editor (me@example.com)', $feed->author);
13
    }
14
 
15
    function test_channel_author_map_author_detail_email_1() {
16
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/rss/channel_author_map_author_detail_email.xml');
17
 
18
        $feed = new XML_Feed_Parser($content);
19
 
20
        $this->assertEquals('me@example.com', $feed->author(0, 'email'));
21
    }
22
 
23
    function test_channel_author_map_author_detail_email_2_1() {
24
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/rss/channel_author_map_author_detail_email_2.xml');
25
 
26
        $feed = new XML_Feed_Parser($content);
27
 
28
        $this->assertEquals('me+spam@example.com', $feed->author(0, 'email'));
29
    }
30
 
31
    function test_channel_author_map_author_detail_email_3_1() {
32
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/rss/channel_author_map_author_detail_email_3.xml');
33
 
34
        $feed = new XML_Feed_Parser($content);
35
 
36
        $this->assertEquals('me@example.com', $feed->author(0, 'email'));
37
    }
38
 
39
    function test_channel_author_map_author_detail_name_1() {
40
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/rss/channel_author_map_author_detail_name.xml');
41
 
42
        $feed = new XML_Feed_Parser($content);
43
 
44
        $this->assertEquals('Example editor', $feed->author(0, 'name'));
45
    }
46
 
47
    function test_channel_author_map_author_detail_name_2_1() {
48
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/rss/channel_author_map_author_detail_name_2.xml');
49
 
50
        $feed = new XML_Feed_Parser($content);
51
 
52
        $this->assertEquals('Example editor', $feed->author(0, 'name'));
53
    }
54
 
55
    function test_channel_category_1() {
56
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/rss/channel_category.xml');
57
 
58
        $feed = new XML_Feed_Parser($content);
59
 
60
        $this->assertEquals('Example category', $feed->category);
61
    }
62
 
63
    function test_channel_category_domain_1() {
64
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/rss/channel_category_domain.xml');
65
 
66
        $feed = new XML_Feed_Parser($content);
67
 
68
        $this->assertEquals('http://www.example.com/', $feed->categories[0][0]);
69
    }
70
 
71
    function test_channel_category_multiple_1() {
72
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/rss/channel_category_multiple.xml');
73
 
74
        $feed = new XML_Feed_Parser($content);
75
 
76
        $this->assertEquals('http://www.example.com/2', $feed->categories[1][0]);
77
    }
78
 
79
    function test_channel_category_multiple_2_1() {
80
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/rss/channel_category_multiple_2.xml');
81
 
82
        $feed = new XML_Feed_Parser($content);
83
 
84
        $this->assertEquals('Example category 2', $feed->categories[1][1]);
85
    }
86
 
87
    function test_channel_cloud_domain_1() {
88
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/rss/channel_cloud_domain.xml');
89
 
90
        $feed = new XML_Feed_Parser($content);
91
 
92
        $this->assertEquals('rpc.sys.com', $feed->cloud(0, 'domain'));
93
    }
94
 
95
    function test_channel_cloud_path_1() {
96
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/rss/channel_cloud_path.xml');
97
 
98
        $feed = new XML_Feed_Parser($content);
99
 
100
        $this->assertEquals('/RPC2', $feed->cloud(0, 'path'));
101
    }
102
 
103
    function test_channel_cloud_port_1() {
104
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/rss/channel_cloud_port.xml');
105
 
106
        $feed = new XML_Feed_Parser($content);
107
 
108
        $this->assertEquals('80', $feed->cloud(0, 'port'));
109
    }
110
 
111
    function test_channel_cloud_protocol_1() {
112
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/rss/channel_cloud_protocol.xml');
113
 
114
        $feed = new XML_Feed_Parser($content);
115
 
116
        $this->assertEquals('xml-rpc', $feed->cloud(0, 'protocol'));
117
    }
118
 
119
    function test_channel_cloud_registerProcedure_1() {
120
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/rss/channel_cloud_registerProcedure.xml');
121
 
122
        $feed = new XML_Feed_Parser($content);
123
 
124
        $this->assertEquals('myCloud.rssPleaseNotify', $feed->cloud(0, 'registerprocedure'));
125
    }
126
 
127
    function test_channel_copyright_1() {
128
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/rss/channel_copyright.xml');
129
 
130
        $feed = new XML_Feed_Parser($content);
131
 
132
        $this->assertEquals('Example copyright', $feed->copyright);
133
    }
134
 
135
    function test_channel_dc_author_1() {
136
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/rss/channel_dc_author.xml');
137
 
138
        $feed = new XML_Feed_Parser($content);
139
 
140
        $this->assertEquals('Example editor', $feed->author);
141
    }
142
 
143
    function test_channel_dc_author_map_author_detail_email_1() {
144
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/rss/channel_dc_author_map_author_detail_email.xml');
145
 
146
        $feed = new XML_Feed_Parser($content);
147
 
148
        $this->assertEquals('me@example.com', $feed->author(0, 'email'));
149
    }
150
 
151
    function test_channel_dc_author_map_author_detail_name_1() {
152
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/rss/channel_dc_author_map_author_detail_name.xml');
153
 
154
        $feed = new XML_Feed_Parser($content);
155
 
156
        $this->assertEquals('Example editor', $feed->author(0, 'name'));
157
    }
158
 
159
    function test_channel_dc_contributor_1() {
160
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/rss/channel_dc_contributor.xml');
161
 
162
        $feed = new XML_Feed_Parser($content);
163
 
164
        $this->assertEquals('Example contributor', $feed->contributors(0, 'name'));
165
    }
166
 
167
    function test_channel_dc_creator_1() {
168
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/rss/channel_dc_creator.xml');
169
 
170
        $feed = new XML_Feed_Parser($content);
171
 
172
        $this->assertEquals('Example editor', $feed->author);
173
    }
174
 
175
    function test_channel_dc_creator_map_author_detail_email_1() {
176
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/rss/channel_dc_creator_map_author_detail_email.xml');
177
 
178
        $feed = new XML_Feed_Parser($content);
179
 
180
        $this->assertEquals('me@example.com', $feed->author(0, 'email'));
181
    }
182
 
183
    function test_channel_dc_creator_map_author_detail_name_1() {
184
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/rss/channel_dc_creator_map_author_detail_name.xml');
185
 
186
        $feed = new XML_Feed_Parser($content);
187
 
188
        $this->assertEquals('Example editor', $feed->author(0, 'name'));
189
    }
190
 
191
    function test_channel_dc_publisher_1() {
192
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/rss/channel_dc_publisher.xml');
193
 
194
        $feed = new XML_Feed_Parser($content);
195
 
196
        $this->assertEquals('Example editor', $feed->publisher);
197
    }
198
 
199
    function test_channel_dc_publisher_email_1() {
200
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/rss/channel_dc_publisher_email.xml');
201
 
202
        $feed = new XML_Feed_Parser($content);
203
 
204
        $this->assertEquals('me@example.com', $feed->publisher(0, 'email'));
205
    }
206
 
207
    function test_channel_dc_publisher_name_1() {
208
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/rss/channel_dc_publisher_name.xml');
209
 
210
        $feed = new XML_Feed_Parser($content);
211
 
212
        $this->assertEquals('Example editor', $feed->publisher(0, 'name'));
213
    }
214
 
215
    function test_channel_dc_rights_1() {
216
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/rss/channel_dc_rights.xml');
217
 
218
        $feed = new XML_Feed_Parser($content);
219
 
220
        $this->assertEquals('Example copyright', $feed->copyright);
221
    }
222
 
223
    function test_channel_dc_subject_1() {
224
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/rss/channel_dc_subject.xml');
225
 
226
        $feed = new XML_Feed_Parser($content);
227
 
228
        $this->assertEquals('Example category', $feed->category);
229
    }
230
 
231
    function test_channel_dc_subject_2_1() {
232
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/rss/channel_dc_subject_2.xml');
233
 
234
        $feed = new XML_Feed_Parser($content);
235
 
236
        $this->assertEquals('Example category', $feed->categories[0][1]);
237
    }
238
 
239
    function test_channel_dc_subject_multiple_1() {
240
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/rss/channel_dc_subject_multiple.xml');
241
 
242
        $feed = new XML_Feed_Parser($content);
243
 
244
        $this->assertEquals('Example category 2', $feed->categories[1][1]);
245
    }
246
 
247
    function test_channel_dc_title_1() {
248
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/rss/channel_dc_title.xml');
249
 
250
        $feed = new XML_Feed_Parser($content);
251
 
252
        $this->assertEquals('Example title', $feed->title);
253
    }
254
 
255
    function test_channel_description_1() {
256
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/rss/channel_description.xml');
257
 
258
        $feed = new XML_Feed_Parser($content);
259
 
260
        $this->assertEquals('Example description', $feed->description);
261
    }
262
 
263
    function test_channel_description_escaped_markup_1() {
264
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/rss/channel_description_escaped_markup.xml');
265
 
266
        $feed = new XML_Feed_Parser($content);
267
 
268
        $this->assertEquals('<p>Example description</p>', $feed->description);
269
    }
270
 
271
    function test_channel_description_map_tagline_1() {
272
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/rss/channel_description_map_tagline.xml');
273
 
274
        $feed = new XML_Feed_Parser($content);
275
 
276
        $this->assertEquals('Example description', $feed->tagline);
277
    }
278
 
279
    function test_channel_description_naked_markup_1() {
280
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/rss/channel_description_naked_markup.xml');
281
 
282
        $feed = new XML_Feed_Parser($content);
283
 
284
        $this->assertEquals('<p>Example description</p>', $feed->description);
285
    }
286
 
287
    function test_channel_description_shorttag_1() {
288
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/rss/channel_description_shorttag.xml');
289
 
290
        $feed = new XML_Feed_Parser($content);
291
 
292
        $this->assertEquals('', $feed->description);
293
    }
294
 
295
    function test_channel_description_shorttag_2() {
296
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/rss/channel_description_shorttag.xml');
297
 
298
        $feed = new XML_Feed_Parser($content);
299
 
300
        $this->assertEquals('http://example.com/', $feed->link);
301
    }
302
 
303
    function test_channel_docs_1() {
304
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/rss/channel_docs.xml');
305
 
306
        $feed = new XML_Feed_Parser($content);
307
 
308
        $this->assertEquals('http://www.example.com/', $feed->docs);
309
    }
310
 
311
    function test_channel_generator_1() {
312
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/rss/channel_generator.xml');
313
 
314
        $feed = new XML_Feed_Parser($content);
315
 
316
        $this->assertEquals('Example generator', $feed->generator);
317
    }
318
 
319
    function test_channel_image_description_1() {
320
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/rss/channel_image_description.xml');
321
 
322
        $feed = new XML_Feed_Parser($content, false, true);
323
 
324
        $this->assertEquals('Available in Netscape RSS 0.91', $feed->image(0, 'description'));
325
    }
326
 
327
    function test_channel_image_height_1() {
328
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/rss/channel_image_height.xml');
329
 
330
        $feed = new XML_Feed_Parser($content);
331
 
332
        $this->assertEquals(15, $feed->image(0, 'height'));
333
    }
334
 
335
    function test_channel_image_link_1() {
336
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/rss/channel_image_link.xml');
337
 
338
        $feed = new XML_Feed_Parser($content);
339
 
340
        $this->assertEquals('http://example.org/link', $feed->image(0, 'link'));
341
    }
342
 
343
    function test_channel_image_link_conflict_1() {
344
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/rss/channel_image_link_conflict.xml');
345
 
346
        $feed = new XML_Feed_Parser($content);
347
 
348
        $this->assertEquals('http://channel.example.com/', $feed->link);
349
    }
350
 
351
    function test_channel_image_title_1() {
352
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/rss/channel_image_title.xml');
353
 
354
        $feed = new XML_Feed_Parser($content);
355
 
356
        $this->assertEquals('Sample image', $feed->image(0, 'title'));
357
    }
358
 
359
    function test_channel_image_title_conflict_1() {
360
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/rss/channel_image_title_conflict.xml');
361
 
362
        $feed = new XML_Feed_Parser($content);
363
 
364
        $this->assertEquals('Real title', $feed->title);
365
    }
366
 
367
    function test_channel_image_url_1() {
368
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/rss/channel_image_url.xml');
369
 
370
        $feed = new XML_Feed_Parser($content);
371
 
372
        $this->assertEquals('http://example.org/url', $feed->image(0, 'url'));
373
    }
374
 
375
    function test_channel_image_width_1() {
376
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/rss/channel_image_width.xml');
377
 
378
        $feed = new XML_Feed_Parser($content);
379
 
380
        $this->assertEquals(80, $feed->image(0, 'width'));
381
    }
382
 
383
    function test_channel_link_1() {
384
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/rss/channel_link.xml');
385
 
386
        $feed = new XML_Feed_Parser($content);
387
 
388
        $this->assertEquals('http://example.com/', $feed->link);
389
    }
390
 
391
    function test_channel_managingEditor_1() {
392
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/rss/channel_managingEditor.xml');
393
 
394
        $feed = new XML_Feed_Parser($content);
395
 
396
        $this->assertEquals('Example editor', $feed->author);
397
    }
398
 
399
    function test_channel_managingEditor_map_author_detail_email_1() {
400
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/rss/channel_managingEditor_map_author_detail_email.xml');
401
 
402
        $feed = new XML_Feed_Parser($content);
403
 
404
        $this->assertEquals('me@example.com', $feed->author(0, 'email'));
405
    }
406
 
407
    function test_channel_managingEditor_map_author_detail_name_1() {
408
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/rss/channel_managingEditor_map_author_detail_name.xml');
409
 
410
        $feed = new XML_Feed_Parser($content);
411
 
412
        $this->assertEquals('Example editor', $feed->author(0, 'name'));
413
    }
414
 
415
    function test_channel_textInput_description_1() {
416
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/rss/channel_textInput_description.xml');
417
 
418
        $feed = new XML_Feed_Parser($content);
419
 
420
        $this->assertEquals('textInput description', $feed->textinput(0, 'description'));
421
    }
422
 
423
    function test_channel_textInput_description_conflict_1() {
424
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/rss/channel_textInput_description_conflict.xml');
425
 
426
        $feed = new XML_Feed_Parser($content);
427
 
428
        $this->assertEquals('Real description', $feed->description);
429
    }
430
 
431
    function test_channel_textInput_link_1() {
432
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/rss/channel_textInput_link.xml');
433
 
434
        $feed = new XML_Feed_Parser($content);
435
 
436
        $this->assertEquals('http://textinput.example.com/', $feed->textinput(0, 'link'));
437
    }
438
 
439
    function test_channel_textInput_link_conflict_1() {
440
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/rss/channel_textInput_link_conflict.xml');
441
 
442
        $feed = new XML_Feed_Parser($content);
443
 
444
        $this->assertEquals('http://channel.example.com/', $feed->link);
445
    }
446
 
447
    function test_channel_textInput_name_1() {
448
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/rss/channel_textInput_name.xml');
449
 
450
        $feed = new XML_Feed_Parser($content);
451
 
452
        $this->assertEquals('textinput name', $feed->textinput(0, 'name'));
453
    }
454
 
455
    function test_channel_textInput_title_1() {
456
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/rss/channel_textInput_title.xml');
457
 
458
        $feed = new XML_Feed_Parser($content);
459
 
460
        $this->assertEquals('textInput title', $feed->textinput(0, 'title'));
461
    }
462
 
463
    function test_channel_textInput_title_conflict_1() {
464
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/rss/channel_textInput_title_conflict.xml');
465
 
466
        $feed = new XML_Feed_Parser($content);
467
 
468
        $this->assertEquals('Real title', $feed->title);
469
    }
470
 
471
    function test_channel_title_1() {
472
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/rss/channel_title.xml');
473
 
474
        $feed = new XML_Feed_Parser($content);
475
 
476
        $this->assertEquals('Example feed', $feed->title);
477
    }
478
 
479
    function test_channel_title_apos_1() {
480
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/rss/channel_title_apos.xml');
481
 
482
        $feed = new XML_Feed_Parser($content, false, true);
483
 
484
        $this->assertEquals("Mark's title", $feed->title);
485
    }
486
 
487
    function test_channel_title_gt_1() {
488
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/rss/channel_title_gt.xml');
489
 
490
        $feed = new XML_Feed_Parser($content, false, true);
491
 
492
        $this->assertEquals('2 > 1', $feed->title);
493
    }
494
 
495
    function test_channel_title_lt_1() {
496
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/rss/channel_title_lt.xml');
497
 
498
        $feed = new XML_Feed_Parser($content, false, true);
499
 
500
        $this->assertEquals('1 < 2', $feed->title);
501
    }
502
 
503
    function test_channel_ttl_1() {
504
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/rss/channel_ttl.xml');
505
 
506
        $feed = new XML_Feed_Parser($content);
507
 
508
        $this->assertEquals('60', $feed->ttl);
509
    }
510
 
511
    function test_channel_webMaster_1() {
512
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/rss/channel_webMaster.xml');
513
 
514
        $feed = new XML_Feed_Parser($content);
515
 
516
        $this->assertEquals('Example editor', $feed->publisher);
517
    }
518
 
519
    function test_channel_webMaster_email_1() {
520
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/rss/channel_webMaster_email.xml');
521
 
522
        $feed = new XML_Feed_Parser($content);
523
 
524
        $this->assertEquals('me@example.com', $feed->publisher(0, 'email'));
525
    }
526
 
527
    function test_channel_webMaster_name_1() {
528
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/rss/channel_webMaster_name.xml');
529
 
530
        $feed = new XML_Feed_Parser($content);
531
 
532
        $this->assertEquals('Example editor', $feed->publisher(0, 'name'));
533
    }
534
 
535
    function test_item_author_1() {
536
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/rss/item_author.xml');
537
 
538
        $feed = new XML_Feed_Parser($content);
539
 
540
        $this->assertEquals('Example editor', $feed->getEntryByOffset(0)->author);
541
    }
542
 
543
    function test_item_author_map_author_detail_email_1() {
544
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/rss/item_author_map_author_detail_email.xml');
545
 
546
        $feed = new XML_Feed_Parser($content);
547
 
548
        $this->assertEquals('me@example.com', $feed->getEntryByOffset(0)->author(0, 'email'));
549
    }
550
 
551
    function test_item_author_map_author_detail_name_1() {
552
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/rss/item_author_map_author_detail_name.xml');
553
 
554
        $feed = new XML_Feed_Parser($content);
555
 
556
        $this->assertEquals('Example editor', $feed->getEntryByOffset(0)->author(0, 'name'));
557
    }
558
 
559
    function test_item_category_1() {
560
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/rss/item_category.xml');
561
 
562
        $feed = new XML_Feed_Parser($content);
563
 
564
        $this->assertEquals('Example category', $feed->getEntryByOffset(0)->category);
565
    }
566
 
567
    function test_item_category_domain_1() {
568
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/rss/item_category_domain.xml');
569
 
570
        $feed = new XML_Feed_Parser($content);
571
 
572
        $this->assertEquals('http://www.example.com/', $feed->getEntryByOffset(0)->categories[0][0]);
573
    }
574
 
575
    function test_item_category_multiple_1() {
576
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/rss/item_category_multiple.xml');
577
 
578
        $feed = new XML_Feed_Parser($content);
579
 
580
        $this->assertEquals('http://www.example.com/2', $feed->getEntryByOffset(0)->categories[1][0]);
581
    }
582
 
583
    function test_item_category_multiple_2_1() {
584
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/rss/item_category_multiple_2.xml');
585
 
586
        $feed = new XML_Feed_Parser($content);
587
 
588
        $this->assertEquals('Example category 2', $feed->getEntryByOffset(0)->categories[1][1]);
589
    }
590
 
591
    function test_item_comments_1() {
592
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/rss/item_comments.xml');
593
 
594
        $feed = new XML_Feed_Parser($content);
595
 
596
        $this->assertEquals('http://example.com/', $feed->getEntryByOffset(0)->comments);
597
    }
598
 
599
    function test_item_content_encoded_1() {
600
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/rss/item_content_encoded.xml');
601
 
602
        $feed = new XML_Feed_Parser($content);
603
 
604
        $this->assertEquals('<p>Example content</p>', $feed->getEntryByOffset(0)->content(0, 'value'));
605
    }
606
 
607
    function test_item_content_encoded_mode_0() {
608
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/rss/item_content_encoded_mode.xml');
609
 
610
        $feed = new XML_Feed_Parser($content);
611
 
612
        $this->markTestIncomplete("Not yet implemented");
613
    }
614
 
615
    function test_item_content_encoded_type_1() {
616
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/rss/item_content_encoded_type.xml');
617
 
618
        $feed = new XML_Feed_Parser($content);
619
 
620
        $this->assertEquals('text/html', $feed->getEntryByOffset(0)->content(0, 'type'));
621
    }
622
 
623
    function test_item_dc_author_1() {
624
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/rss/item_dc_author.xml');
625
 
626
        $feed = new XML_Feed_Parser($content);
627
 
628
        $this->assertEquals('Example editor', $feed->getEntryByOffset(0)->author);
629
    }
630
 
631
    function test_item_dc_author_map_author_detail_email_1() {
632
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/rss/item_dc_author_map_author_detail_email.xml');
633
 
634
        $feed = new XML_Feed_Parser($content);
635
 
636
        $this->assertEquals('me@example.com', $feed->getEntryByOffset(0)->author(0, 'email'));
637
    }
638
 
639
    function test_item_dc_author_map_author_detail_name_1() {
640
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/rss/item_dc_author_map_author_detail_name.xml');
641
 
642
        $feed = new XML_Feed_Parser($content);
643
 
644
        $this->assertEquals('Example editor', $feed->getEntryByOffset(0)->author(0, 'name'));
645
    }
646
 
647
    function test_item_dc_contributor_1() {
648
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/rss/item_dc_contributor.xml');
649
 
650
        $feed = new XML_Feed_Parser($content);
651
 
652
        $this->assertEquals('Example contributor', $feed->getEntryByOffset(0)->contributors(0, 'name'));
653
    }
654
 
655
    function test_item_dc_creator_1() {
656
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/rss/item_dc_creator.xml');
657
 
658
        $feed = new XML_Feed_Parser($content);
659
 
660
        $this->assertEquals('Example editor', $feed->getEntryByOffset(0)->author);
661
    }
662
 
663
    function test_item_dc_creator_map_author_detail_email_1() {
664
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/rss/item_dc_creator_map_author_detail_email.xml');
665
 
666
        $feed = new XML_Feed_Parser($content);
667
 
668
        $this->assertEquals('me@example.com', $feed->getEntryByOffset(0)->author(0, 'email'));
669
    }
670
 
671
    function test_item_dc_creator_map_author_detail_name_1() {
672
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/rss/item_dc_creator_map_author_detail_name.xml');
673
 
674
        $feed = new XML_Feed_Parser($content);
675
 
676
        $this->assertEquals('Example editor', $feed->getEntryByOffset(0)->author(0, 'name'));
677
    }
678
 
679
    function test_item_dc_publisher_1() {
680
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/rss/item_dc_publisher.xml');
681
 
682
        $feed = new XML_Feed_Parser($content);
683
 
684
        $this->assertEquals('Example editor', $feed->getEntryByOffset(0)->publisher);
685
    }
686
 
687
    function test_item_dc_publisher_email_1() {
688
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/rss/item_dc_publisher_email.xml');
689
 
690
        $feed = new XML_Feed_Parser($content);
691
 
692
        $this->assertEquals('me@example.com', $feed->getEntryByOffset(0)->publisher(0, 'email'));
693
    }
694
 
695
    function test_item_dc_publisher_name_1() {
696
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/rss/item_dc_publisher_name.xml');
697
 
698
        $feed = new XML_Feed_Parser($content);
699
 
700
        $this->assertEquals('Example editor', $feed->getEntryByOffset(0)->publisher(0, 'name'));
701
    }
702
 
703
    function test_item_dc_rights_1() {
704
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/rss/item_dc_rights.xml');
705
 
706
        $feed = new XML_Feed_Parser($content);
707
 
708
        $this->assertEquals('Example copyright', $feed->getEntryByOffset(0)->copyright);
709
    }
710
 
711
    function test_item_dc_subject_1() {
712
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/rss/item_dc_subject.xml');
713
 
714
        $feed = new XML_Feed_Parser($content);
715
 
716
        $this->assertEquals('Example category', $feed->getEntryByOffset(0)->category);
717
    }
718
 
719
    function test_item_dc_subject_2_1() {
720
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/rss/item_dc_subject_2.xml');
721
 
722
        $feed = new XML_Feed_Parser($content);
723
 
724
        $this->assertEquals('Example category', $feed->getEntryByOffset(0)->categories[0][1]);
725
    }
726
 
727
    function test_item_dc_subject_multiple_1() {
728
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/rss/item_dc_subject_multiple.xml');
729
 
730
        $feed = new XML_Feed_Parser($content);
731
 
732
        $this->assertEquals('Example category 2', $feed->getEntryByOffset(0)->categories[1][1]);
733
    }
734
 
735
    function test_item_dc_title_1() {
736
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/rss/item_dc_title.xml');
737
 
738
        $feed = new XML_Feed_Parser($content);
739
 
740
        $this->assertEquals('Example title', $feed->getEntryByOffset(0)->title);
741
    }
742
 
743
    function test_item_description_1() {
744
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/rss/item_description.xml');
745
 
746
        $feed = new XML_Feed_Parser($content);
747
 
748
        $this->assertEquals('Example description', $feed->getEntryByOffset(0)->description);
749
    }
750
 
751
    function test_item_description_and_summary_1() {
752
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/rss/item_description_and_summary.xml');
753
 
754
        $feed = new XML_Feed_Parser($content);
755
 
756
        $this->assertEquals('Example description', $feed->getEntryByOffset(0)->description);
757
    }
758
 
759
    function test_item_description_and_summary_2() {
760
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/rss/item_description_and_summary.xml');
761
 
762
        $feed = new XML_Feed_Parser($content);
763
 
764
        $this->assertEquals('Example summary', $feed->getEntryByOffset(0)->content(0, 'value'));
765
    }
766
 
767
    function test_item_description_br_1() {
768
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/rss/item_description_br.xml');
769
 
770
        $feed = new XML_Feed_Parser($content);
771
 
772
        $this->assertEquals('article title<br /><br /> article byline<br /><br />text of article', $feed->getEntryByOffset(0)->description);
773
    }
774
 
775
    function test_item_description_escaped_markup_1() {
776
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/rss/item_description_escaped_markup.xml');
777
 
778
        $feed = new XML_Feed_Parser($content);
779
 
780
        $this->assertEquals('<p>Example description</p>', $feed->getEntryByOffset(0)->description);
781
    }
782
 
783
    function test_item_description_map_summary_1() {
784
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/rss/item_description_map_summary.xml');
785
 
786
        $feed = new XML_Feed_Parser($content);
787
 
788
        $this->assertEquals('Example description', $feed->getEntryByOffset(0)->summary);
789
    }
790
 
791
    function test_item_description_naked_markup_1() {
792
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/rss/item_description_naked_markup.xml');
793
 
794
        $feed = new XML_Feed_Parser($content);
795
 
796
        $this->assertEquals('<p>Example description</p>', $feed->getEntryByOffset(0)->description);
797
    }
798
 
799
    function test_item_description_not_a_doctype_1() {
800
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/rss/item_description_not_a_doctype.xml');
801
 
802
        $feed = new XML_Feed_Parser($content, false, true);
803
 
804
        $this->markTestIncomplete("Expected result needs verification");
805
        //$this->assertEquals("""&lt;!' <a href="foo">""", $feed->getEntryByOffset(0)->description);
806
    }
807
 
808
    function test_item_enclosure_length_1() {
809
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/rss/item_enclosure_length.xml');
810
 
811
        $feed = new XML_Feed_Parser($content);
812
 
813
        $this->assertEquals('100000', $feed->getEntryByOffset(0)->enclosures(0, 'length'));
814
    }
815
 
816
    function test_item_enclosure_multiple_1() {
817
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/rss/item_enclosure_multiple.xml');
818
 
819
        $feed = new XML_Feed_Parser($content);
820
 
821
        $this->assertEquals(array('href' => 'http://example.com/2', 'length' => '200000', 'type' => 'image/gif'), $feed->getEntryByOffset(0)->enclosures[1]);
822
    }
823
 
824
    function test_item_enclosure_type_1() {
825
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/rss/item_enclosure_type.xml');
826
 
827
        $feed = new XML_Feed_Parser($content);
828
 
829
        $this->assertEquals('image/jpeg', $feed->getEntryByOffset(0)->enclosures(0, 'type'));
830
    }
831
 
832
    function test_item_enclosure_url_1() {
833
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/rss/item_enclosure_url.xml');
834
 
835
        $feed = new XML_Feed_Parser($content);
836
 
837
        $this->assertEquals('http://example.com/', $feed->getEntryByOffset(0)->enclosures(0, 'url'));
838
    }
839
 
840
    function test_item_fullitem_1() {
841
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/rss/item_fullitem.xml');
842
 
843
        $feed = new XML_Feed_Parser($content);
844
 
845
        $this->assertEquals('<p>Example content</p>', $feed->getEntryByOffset(0)->content(0, 'value'));
846
    }
847
 
848
    function test_item_fullitem_mode_0() {
849
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/rss/item_fullitem_mode.xml');
850
 
851
        $feed = new XML_Feed_Parser($content);
852
 
853
        $this->markTestIncomplete("Not yet implemented");
854
    }
855
 
856
    function test_item_fullitem_type_1() {
857
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/rss/item_fullitem_type.xml');
858
 
859
        $feed = new XML_Feed_Parser($content);
860
 
861
        $this->assertEquals('text/html', $feed->getEntryByOffset(0)->content(0, 'type'));
862
    }
863
 
864
    function test_item_guid_1() {
865
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/rss/item_guid.xml');
866
 
867
        $feed = new XML_Feed_Parser($content);
868
 
869
        $this->assertEquals('http://guid.example.com/', $feed->getEntryByOffset(0)->guid);
870
    }
871
 
872
    function test_item_guid_conflict_link_1() {
873
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/rss/item_guid_conflict_link.xml');
874
 
875
        $feed = new XML_Feed_Parser($content);
876
 
877
        $this->assertEquals('http://link.example.com/', $feed->getEntryByOffset(0)->link);
878
    }
879
 
880
    function test_item_guid_guidislink_1() {
881
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/rss/item_guid_guidislink.xml');
882
 
883
        $feed = new XML_Feed_Parser($content);
884
 
885
        $this->markTestIncomplete("Expected result needs verification");
886
        //$this->assertEquals(, $feed->getEntryByOffset(0)->guidislink);
887
    }
888
 
889
    function test_item_guid_isPermaLink_conflict_link_1() {
890
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/rss/item_guid_isPermaLink_conflict_link.xml');
891
 
892
        $feed = new XML_Feed_Parser($content);
893
 
894
        $this->assertEquals('http://link.example.com/', $feed->getEntryByOffset(0)->link);
895
    }
896
 
897
    function test_item_guid_isPermaLink_conflict_link_not_guidislink_1() {
898
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/rss/item_guid_isPermaLink_conflict_link_not_guidislink.xml');
899
 
900
        $feed = new XML_Feed_Parser($content);
901
 
902
        $this->markTestIncomplete("Expected result needs verification");
903
        //$this->assertEquals(, ! $feed->getEntryByOffset(0)->guidislink);
904
    }
905
 
906
    function test_item_guid_isPermaLink_guidislink_1() {
907
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/rss/item_guid_isPermaLink_guidislink.xml');
908
 
909
        $feed = new XML_Feed_Parser($content);
910
 
911
        $this->markTestIncomplete("Expected result needs verification");
912
        //$this->assertEquals(, $feed->getEntryByOffset(0)->guidislink);
913
    }
914
 
915
    function test_item_guid_isPermaLink_map_link_1() {
916
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/rss/item_guid_isPermaLink_map_link.xml');
917
 
918
        $feed = new XML_Feed_Parser($content);
919
 
920
        $this->assertEquals('http://guid.example.com/', $feed->getEntryByOffset(0)->link);
921
    }
922
 
923
    function test_item_guid_map_link_1() {
924
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/rss/item_guid_map_link.xml');
925
 
926
        $feed = new XML_Feed_Parser($content);
927
 
928
        $this->assertEquals('http://guid.example.com/', $feed->getEntryByOffset(0)->link);
929
    }
930
 
931
    function test_item_guid_not_permalink_1() {
932
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/rss/item_guid_not_permalink.xml');
933
 
934
        $feed = new XML_Feed_Parser($content);
935
 
936
        $this->markTestIncomplete("Expected result needs verification");
937
        //$this->assertEquals(, ! $feed->getEntryByOffset(0).has_key(->));
938
    }
939
 
940
    function test_item_guid_not_permalink_conflict_link_1() {
941
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/rss/item_guid_not_permalink_conflict_link.xml');
942
 
943
        $feed = new XML_Feed_Parser($content);
944
 
945
        $this->assertEquals('http://link.example.com/', $feed->getEntryByOffset(0)->link);
946
    }
947
 
948
    function test_item_guid_not_permalink_not_guidislink_1() {
949
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/rss/item_guid_not_permalink_not_guidislink.xml');
950
 
951
        $feed = new XML_Feed_Parser($content);
952
 
953
        $this->markTestIncomplete("Expected result needs verification");
954
        //$this->assertEquals(, ! $feed->getEntryByOffset(0)->guidislink);
955
    }
956
 
957
    function test_item_guid_not_permalink_not_guidislink_2_1() {
958
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/rss/item_guid_not_permalink_not_guidislink_2.xml');
959
 
960
        $feed = new XML_Feed_Parser($content);
961
 
962
        $this->markTestIncomplete("Expected result needs verification");
963
        //$this->assertEquals(, ! $feed->getEntryByOffset(0)->guidislink);
964
    }
965
 
966
    function test_item_link_1() {
967
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/rss/item_link.xml');
968
 
969
        $feed = new XML_Feed_Parser($content);
970
 
971
        $this->assertEquals('http://example.com/', $feed->getEntryByOffset(0)->link);
972
    }
973
 
974
    function test_item_source_0() {
975
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/rss/item_source.xml');
976
 
977
        $feed = new XML_Feed_Parser($content);
978
 
979
        $this->markTestIncomplete("Not yet implemented");
980
    }
981
 
982
    function test_item_source_url_0() {
983
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/rss/item_source_url.xml');
984
 
985
        $feed = new XML_Feed_Parser($content);
986
 
987
        $this->markTestIncomplete("Not yet implemented");
988
    }
989
 
990
    function test_item_summary_and_description_1() {
991
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/rss/item_summary_and_description.xml');
992
 
993
        $feed = new XML_Feed_Parser($content);
994
 
995
        $this->assertEquals('Example summary', $feed->getEntryByOffset(0)->summary);
996
    }
997
 
998
    function test_item_summary_and_description_2() {
999
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/rss/item_summary_and_description.xml');
1000
 
1001
        $feed = new XML_Feed_Parser($content);
1002
 
1003
        $this->assertEquals('Example description', $feed->getEntryByOffset(0)->content(0, 'value'));
1004
    }
1005
 
1006
    function test_item_title_1() {
1007
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/rss/item_title.xml');
1008
 
1009
        $feed = new XML_Feed_Parser($content);
1010
 
1011
        $this->assertEquals('Item 1 title', $feed->getEntryByOffset(0)->title);
1012
    }
1013
 
1014
    function test_item_xhtml_body_1() {
1015
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/rss/item_xhtml_body.xml');
1016
 
1017
        $feed = new XML_Feed_Parser($content);
1018
 
1019
        $this->assertEquals('<p>Example content</p>', $feed->getEntryByOffset(0)->content(0, 'value'));
1020
    }
1021
 
1022
    function test_item_xhtml_body_mode_0() {
1023
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/rss/item_xhtml_body_mode.xml');
1024
 
1025
        $feed = new XML_Feed_Parser($content);
1026
 
1027
        $this->markTestIncomplete("Not yet implemented");
1028
    }
1029
 
1030
    function test_item_xhtml_body_type_1() {
1031
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/rss/item_xhtml_body_type.xml');
1032
 
1033
        $feed = new XML_Feed_Parser($content);
1034
 
1035
        $this->assertEquals('application/xhtml+xml', $feed->getEntryByOffset(0)->content(0, 'type'));
1036
    }
1037
 
1038
    function test_rss_namespace_1_1() {
1039
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/rss/rss_namespace_1.xml');
1040
 
1041
        $feed = new XML_Feed_Parser($content, false, true);
1042
 
1043
        $this->assertEquals('Example description', $feed->description);
1044
    }
1045
 
1046
    function test_rss_namespace_2_1() {
1047
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/rss/rss_namespace_2.xml');
1048
 
1049
        $feed = new XML_Feed_Parser($content, false, true);
1050
 
1051
        $this->assertEquals('Example description', $feed->description);
1052
    }
1053
 
1054
    function test_rss_namespace_3_1() {
1055
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/rss/rss_namespace_3.xml');
1056
 
1057
        $feed = new XML_Feed_Parser($content, false, true);
1058
 
1059
        $this->assertEquals('Example description', $feed->description);
1060
    }
1061
 
1062
    function test_rss_namespace_4_1() {
1063
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/rss/rss_namespace_4.xml');
1064
 
1065
        $feed = new XML_Feed_Parser($content, false, true);
1066
 
1067
        $this->assertEquals('Example description', $feed->description);
1068
    }
1069
 
1070
    function test_rss_version_090_1() {
1071
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/rss/rss_version_090.xml');
1072
 
1073
        $feed = new XML_Feed_Parser($content);
1074
 
1075
        $this->assertEquals('rss090', $feed->version());
1076
    }
1077
 
1078
    function test_rss_version_091_netscape_1() {
1079
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/rss/rss_version_091_netscape.xml');
1080
 
1081
        $feed = new XML_Feed_Parser($content, false, true);
1082
 
1083
        $this->assertEquals('rss20', $feed->version(), "Expected to load RSS 2.0 driver, because 0.92 is deprecated");
1084
    }
1085
 
1086
    function test_rss_version_091_userland_1() {
1087
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/rss/rss_version_091_userland.xml');
1088
 
1089
        $feed = new XML_Feed_Parser($content, false, true);
1090
 
1091
        $this->assertEquals('rss20', $feed->version(), "Expected to load RSS 2.0 driver, because 0.91 is deprecated");
1092
    }
1093
 
1094
    function test_rss_version_092_1() {
1095
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/rss/rss_version_092.xml');
1096
 
1097
        $feed = new XML_Feed_Parser($content, false, true);
1098
 
1099
        $this->assertEquals('rss20', $feed->version(), "Expected to load RSS 2.0 driver, because 0.92 is deprecated");
1100
    }
1101
 
1102
    function test_rss_version_093_1() {
1103
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/rss/rss_version_093.xml');
1104
 
1105
        $feed = new XML_Feed_Parser($content, false, true);
1106
 
1107
        $this->assertEquals('rss20', $feed->version(), "Expected to load RSS 2.0 driver, because 0.93 is deprecated");
1108
    }
1109
 
1110
    function test_rss_version_094_1() {
1111
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/rss/rss_version_094.xml');
1112
 
1113
        $feed = new XML_Feed_Parser($content, false, true);
1114
 
1115
        $this->assertEquals('rss20', $feed->version(), "Expected to load RSS 2.0 driver, because 0.94 is deprecated");
1116
    }
1117
 
1118
    function test_rss_version_20_1() {
1119
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/rss/rss_version_20.xml');
1120
 
1121
        $feed = new XML_Feed_Parser($content);
1122
 
1123
        $this->assertEquals('rss20', $feed->version());
1124
    }
1125
 
1126
    function test_rss_version_201_1() {
1127
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/rss/rss_version_201.xml');
1128
 
1129
        $feed = new XML_Feed_Parser($content, false, true);
1130
 
1131
        $this->assertEquals('rss20', $feed->version());
1132
    }
1133
 
1134
    function test_rss_version_21_1() {
1135
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/rss/rss_version_21.xml');
1136
 
1137
        $feed = new XML_Feed_Parser($content, false, true);
1138
 
1139
        $this->assertEquals('rss20', $feed->version());
1140
    }
1141
 
1142
    function test_rss_version_missing_1() {
1143
        $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/rss/rss_version_missing.xml');
1144
 
1145
        $feed = new XML_Feed_Parser($content, false, true);
1146
 
1147
        $this->assertEquals('rss', $feed->version());
1148
    }
1149
}
1150
?>