| 1 |
lars |
1 |
<?php
|
|
|
2 |
|
|
|
3 |
require_once 'XML_Feed_Parser_TestCase.php';
|
|
|
4 |
|
|
|
5 |
class rss091Values extends XML_Feed_Parser_TestCase
|
|
|
6 |
{
|
|
|
7 |
function setUp()
|
|
|
8 |
{
|
|
|
9 |
$sample_dir = XML_Feed_Parser_TestCase::getSampleDir();
|
|
|
10 |
$this->file = file_get_contents($sample_dir . DIRECTORY_SEPARATOR . "rss091-complete.xml");
|
|
|
11 |
$this->feed = new XML_Feed_Parser($this->file, false, true);
|
|
|
12 |
$this->entry = $this->feed->getEntryByOffset(0);
|
|
|
13 |
}
|
|
|
14 |
|
|
|
15 |
function test_feedRights()
|
|
|
16 |
{
|
|
|
17 |
$value = "Copyright 1997-1999 UserLand Software, Inc.";
|
|
|
18 |
$this->assertEquals($value, $this->feed->rights);
|
|
|
19 |
$this->assertEquals($value, $this->feed->copyright);
|
|
|
20 |
}
|
|
|
21 |
|
|
|
22 |
function test_feedNumberItems()
|
|
|
23 |
{
|
|
|
24 |
$value = 1;
|
|
|
25 |
$this->assertEquals($value, $this->feed->numberEntries);
|
|
|
26 |
}
|
|
|
27 |
|
|
|
28 |
function test_feedTitle()
|
|
|
29 |
{
|
|
|
30 |
$value = "Scripting News";
|
|
|
31 |
$this->assertEquals($value, $this->feed->title);
|
|
|
32 |
}
|
|
|
33 |
|
|
|
34 |
function test_feedLink()
|
|
|
35 |
{
|
|
|
36 |
$value = "http://www.scripting.com/";
|
|
|
37 |
$this->assertEquals($value, $this->feed->link);
|
|
|
38 |
}
|
|
|
39 |
|
|
|
40 |
function test_feedImage()
|
|
|
41 |
{
|
|
|
42 |
$value = array(
|
|
|
43 |
"title" => "Scripting News",
|
|
|
44 |
"link" => "http://www.scripting.com/",
|
|
|
45 |
"url" => "http://www.scripting.com/gifs/tinyScriptingNews.gif",
|
|
|
46 |
"description" => "What is this used for?",
|
|
|
47 |
'height' => "40",
|
|
|
48 |
'width' => "78");
|
|
|
49 |
$this->assertEquals($value, $this->feed->image);
|
|
|
50 |
}
|
|
|
51 |
|
|
|
52 |
function test_feedDescription()
|
|
|
53 |
{
|
|
|
54 |
$value = "News and commentary from the cross-platform scripting community.";
|
|
|
55 |
$this->assertEquals($value, $this->feed->description);
|
|
|
56 |
}
|
|
|
57 |
|
|
|
58 |
function test_feedSubtitleEquivalence()
|
|
|
59 |
{
|
|
|
60 |
$value = "News and commentary from the cross-platform scripting community.";
|
|
|
61 |
$this->assertEquals($value, $this->feed->subtitle);
|
|
|
62 |
}
|
|
|
63 |
|
|
|
64 |
function test_feedDate()
|
|
|
65 |
{
|
|
|
66 |
$value = strtotime("Thu, 08 Jul 1999 07:00:00 GMT");
|
|
|
67 |
$this->assertEquals($value, $this->feed->date);
|
|
|
68 |
}
|
|
|
69 |
|
|
|
70 |
function test_feedLastBuildDate()
|
|
|
71 |
{
|
|
|
72 |
$value = strtotime("Thu, 08 Jul 1999 16:20:26 GMT");
|
|
|
73 |
$this->assertEquals($value, $this->feed->lastBuildDate);
|
|
|
74 |
}
|
|
|
75 |
|
|
|
76 |
function test_feedUpdatedEquivalence()
|
|
|
77 |
{
|
|
|
78 |
$value = strtotime("Thu, 08 Jul 1999 16:20:26 GMT");
|
|
|
79 |
$this->assertEquals($value, $this->feed->updated);
|
|
|
80 |
}
|
|
|
81 |
|
|
|
82 |
function test_feedLanguage()
|
|
|
83 |
{
|
|
|
84 |
$value = "en-us";
|
|
|
85 |
$this->assertEquals($value, $this->feed->language);
|
|
|
86 |
}
|
|
|
87 |
|
|
|
88 |
function test_feedSkipHours()
|
|
|
89 |
{
|
|
|
90 |
$value = array("6", "7", "8", "9", "10", "11");
|
|
|
91 |
$this->assertEquals($value, $this->feed->skipHours);
|
|
|
92 |
}
|
|
|
93 |
|
|
|
94 |
function test_feedSkipDays()
|
|
|
95 |
{
|
|
|
96 |
$value = array("Sunday");
|
|
|
97 |
$this->assertEquals($value, $this->feed->skipDays);
|
|
|
98 |
}
|
|
|
99 |
|
|
|
100 |
function test_feedDocs()
|
|
|
101 |
{
|
|
|
102 |
$value = "http://my.userland.com/stories/storyReader$11";
|
|
|
103 |
$this->assertEquals($value, $this->feed->docs);
|
|
|
104 |
}
|
|
|
105 |
|
|
|
106 |
function test_feedManagingEditor()
|
|
|
107 |
{
|
|
|
108 |
$value = "dave@userland.com (Dave Winer)";
|
|
|
109 |
$this->assertEquals($value, $this->feed->managingEditor);
|
|
|
110 |
}
|
|
|
111 |
|
|
|
112 |
function test_feedAuthorEquivalence()
|
|
|
113 |
{
|
|
|
114 |
$value = "dave@userland.com (Dave Winer)";
|
|
|
115 |
$this->assertEquals($value, $this->feed->author);
|
|
|
116 |
}
|
|
|
117 |
|
|
|
118 |
function test_feedWebmaster()
|
|
|
119 |
{
|
|
|
120 |
$value = "dave@userland.com (Dave Winer)";
|
|
|
121 |
$this->assertEquals($value, $this->feed->webMaster);
|
|
|
122 |
}
|
|
|
123 |
|
|
|
124 |
function test_entryTitle()
|
|
|
125 |
{
|
|
|
126 |
$value = "stuff";
|
|
|
127 |
$this->assertEquals($value, $this->entry->title);
|
|
|
128 |
}
|
|
|
129 |
|
|
|
130 |
function test_entryLink()
|
|
|
131 |
{
|
|
|
132 |
$value = "http://bar";
|
|
|
133 |
$this->assertEquals($value, $this->entry->link);
|
|
|
134 |
}
|
|
|
135 |
|
|
|
136 |
function test_entryDescription()
|
|
|
137 |
{
|
|
|
138 |
$value = "This is an article about some stuff";
|
|
|
139 |
$this->assertEquals($value, $this->entry->description);
|
|
|
140 |
}
|
|
|
141 |
}
|
|
|
142 |
|
|
|
143 |
?>
|