| 1 |
lars |
1 |
<?php
|
|
|
2 |
|
|
|
3 |
require_once dirname(dirname(__FILE__)) . '/XML_Feed_Parser_TestCase.php';
|
|
|
4 |
|
|
|
5 |
class itunes_TestCase extends XML_Feed_Parser_Converted_TestCase {
|
|
|
6 |
|
|
|
7 |
function test_itunes_channel_block_1() {
|
|
|
8 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/itunes/itunes_channel_block.xml');
|
|
|
9 |
|
|
|
10 |
$feed = new XML_Feed_Parser($content, false, true);
|
|
|
11 |
|
|
|
12 |
$this->assertEquals(1, $feed->itunes_block);
|
|
|
13 |
}
|
|
|
14 |
|
|
|
15 |
function test_itunes_channel_block_false_1() {
|
|
|
16 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/itunes/itunes_channel_block_false.xml');
|
|
|
17 |
|
|
|
18 |
$feed = new XML_Feed_Parser($content, false, true);
|
|
|
19 |
|
|
|
20 |
$this->assertEquals(0, $feed->itunes_block);
|
|
|
21 |
}
|
|
|
22 |
|
|
|
23 |
function test_itunes_channel_block_no_1() {
|
|
|
24 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/itunes/itunes_channel_block_no.xml');
|
|
|
25 |
|
|
|
26 |
$feed = new XML_Feed_Parser($content, false, true);
|
|
|
27 |
|
|
|
28 |
$this->assertEquals(0, $feed->itunes_block);
|
|
|
29 |
}
|
|
|
30 |
|
|
|
31 |
function test_itunes_channel_block_true_1() {
|
|
|
32 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/itunes/itunes_channel_block_true.xml');
|
|
|
33 |
|
|
|
34 |
$feed = new XML_Feed_Parser($content, false, true);
|
|
|
35 |
|
|
|
36 |
$this->assertEquals(0, $feed->itunes_block);
|
|
|
37 |
}
|
|
|
38 |
|
|
|
39 |
function test_itunes_channel_block_uppercase_1() {
|
|
|
40 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/itunes/itunes_channel_block_uppercase.xml');
|
|
|
41 |
|
|
|
42 |
$feed = new XML_Feed_Parser($content, false, true);
|
|
|
43 |
|
|
|
44 |
$this->assertEquals(0, $feed->itunes_block);
|
|
|
45 |
}
|
|
|
46 |
|
|
|
47 |
function test_itunes_channel_block_whitespace_1() {
|
|
|
48 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/itunes/itunes_channel_block_whitespace.xml');
|
|
|
49 |
|
|
|
50 |
$feed = new XML_Feed_Parser($content, false, true);
|
|
|
51 |
|
|
|
52 |
$this->assertEquals(0, $feed->itunes_block);
|
|
|
53 |
}
|
|
|
54 |
|
|
|
55 |
function test_itunes_channel_category_1() {
|
|
|
56 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/itunes/itunes_channel_category.xml');
|
|
|
57 |
|
|
|
58 |
$feed = new XML_Feed_Parser($content, false, true);
|
|
|
59 |
|
|
|
60 |
$this->assertEquals('Technology', $feed->tags(0, 'term'));
|
|
|
61 |
}
|
|
|
62 |
|
|
|
63 |
function test_itunes_channel_category_nested_1() {
|
|
|
64 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/itunes/itunes_channel_category_nested.xml');
|
|
|
65 |
|
|
|
66 |
$feed = new XML_Feed_Parser($content, false, true);
|
|
|
67 |
|
|
|
68 |
$this->assertEquals('Gadgets', $feed->tags(0, 'term'));
|
|
|
69 |
}
|
|
|
70 |
|
|
|
71 |
function test_itunes_channel_category_scheme_1() {
|
|
|
72 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/itunes/itunes_channel_category_scheme.xml');
|
|
|
73 |
|
|
|
74 |
$feed = new XML_Feed_Parser($content, false, true);
|
|
|
75 |
|
|
|
76 |
$this->assertEquals('http://www.itunes.com/', $feed->tags(0, 'scheme'));
|
|
|
77 |
}
|
|
|
78 |
|
|
|
79 |
function test_itunes_channel_explicit_1() {
|
|
|
80 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/itunes/itunes_channel_explicit.xml');
|
|
|
81 |
|
|
|
82 |
$feed = new XML_Feed_Parser($content, false, true);
|
|
|
83 |
|
|
|
84 |
$this->assertEquals(1, $feed->itunes_explicit);
|
|
|
85 |
}
|
|
|
86 |
|
|
|
87 |
function test_itunes_channel_explicit_false_1() {
|
|
|
88 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/itunes/itunes_channel_explicit_false.xml');
|
|
|
89 |
|
|
|
90 |
$feed = new XML_Feed_Parser($content, false, true);
|
|
|
91 |
|
|
|
92 |
$this->assertEquals(0, $feed->itunes_explicit);
|
|
|
93 |
}
|
|
|
94 |
|
|
|
95 |
function test_itunes_channel_explicit_no_1() {
|
|
|
96 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/itunes/itunes_channel_explicit_no.xml');
|
|
|
97 |
|
|
|
98 |
$feed = new XML_Feed_Parser($content, false, true);
|
|
|
99 |
|
|
|
100 |
$this->assertEquals(0, $feed->itunes_explicit);
|
|
|
101 |
}
|
|
|
102 |
|
|
|
103 |
function test_itunes_channel_explicit_true_1() {
|
|
|
104 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/itunes/itunes_channel_explicit_true.xml');
|
|
|
105 |
|
|
|
106 |
$feed = new XML_Feed_Parser($content, false, true);
|
|
|
107 |
|
|
|
108 |
$this->assertEquals(0, $feed->itunes_explicit);
|
|
|
109 |
}
|
|
|
110 |
|
|
|
111 |
function test_itunes_channel_explicit_uppercase_1() {
|
|
|
112 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/itunes/itunes_channel_explicit_uppercase.xml');
|
|
|
113 |
|
|
|
114 |
$feed = new XML_Feed_Parser($content, false, true);
|
|
|
115 |
|
|
|
116 |
$this->assertEquals(0, $feed->itunes_explicit);
|
|
|
117 |
}
|
|
|
118 |
|
|
|
119 |
function test_itunes_channel_explicit_whitespace_1() {
|
|
|
120 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/itunes/itunes_channel_explicit_whitespace.xml');
|
|
|
121 |
|
|
|
122 |
$feed = new XML_Feed_Parser($content, false, true);
|
|
|
123 |
|
|
|
124 |
$this->assertEquals(0, $feed->itunes_explicit);
|
|
|
125 |
}
|
|
|
126 |
|
|
|
127 |
function test_itunes_channel_image_1() {
|
|
|
128 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/itunes/itunes_channel_image.xml');
|
|
|
129 |
|
|
|
130 |
$feed = new XML_Feed_Parser($content, false, true);
|
|
|
131 |
|
|
|
132 |
$this->assertEquals('http://example.com/logo.jpg', $feed->image(0, 'href'));
|
|
|
133 |
}
|
|
|
134 |
|
|
|
135 |
function test_itunes_channel_keywords_1() {
|
|
|
136 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/itunes/itunes_channel_keywords.xml');
|
|
|
137 |
|
|
|
138 |
$feed = new XML_Feed_Parser($content, false, true);
|
|
|
139 |
|
|
|
140 |
$this->assertEquals('Technology', $feed->tags(0, 'term'));
|
|
|
141 |
}
|
|
|
142 |
|
|
|
143 |
function test_itunes_channel_keywords_duplicate_1() {
|
|
|
144 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/itunes/itunes_channel_keywords_duplicate.xml');
|
|
|
145 |
|
|
|
146 |
$feed = new XML_Feed_Parser($content, false, true);
|
|
|
147 |
|
|
|
148 |
$this->assertEquals(1, count($feed->tags));
|
|
|
149 |
}
|
|
|
150 |
|
|
|
151 |
function test_itunes_channel_keywords_duplicate_2_1() {
|
|
|
152 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/itunes/itunes_channel_keywords_duplicate_2.xml');
|
|
|
153 |
|
|
|
154 |
$feed = new XML_Feed_Parser($content, false, true);
|
|
|
155 |
|
|
|
156 |
$this->assertEquals(1, count($feed->tags));
|
|
|
157 |
}
|
|
|
158 |
|
|
|
159 |
function test_itunes_channel_keywords_multiple_1() {
|
|
|
160 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/itunes/itunes_channel_keywords_multiple.xml');
|
|
|
161 |
|
|
|
162 |
$feed = new XML_Feed_Parser($content, false, true);
|
|
|
163 |
|
|
|
164 |
$this->assertEquals('Gadgets', $feed->tags(0, 'term'));
|
|
|
165 |
}
|
|
|
166 |
|
|
|
167 |
function test_itunes_channel_link_image_1() {
|
|
|
168 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/itunes/itunes_channel_link_image.xml');
|
|
|
169 |
|
|
|
170 |
$feed = new XML_Feed_Parser($content, false, true);
|
|
|
171 |
|
|
|
172 |
$this->assertEquals('http://example.com/logo.jpg', $feed->image(0, 'href'));
|
|
|
173 |
}
|
|
|
174 |
|
|
|
175 |
function test_itunes_channel_owner_email_1() {
|
|
|
176 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/itunes/itunes_channel_owner_email.xml');
|
|
|
177 |
|
|
|
178 |
$feed = new XML_Feed_Parser($content, false, true);
|
|
|
179 |
|
|
|
180 |
$this->assertEquals('mark@example.com', $feed->publisher(0, 'email'));
|
|
|
181 |
}
|
|
|
182 |
|
|
|
183 |
function test_itunes_channel_owner_name_1() {
|
|
|
184 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/itunes/itunes_channel_owner_name.xml');
|
|
|
185 |
|
|
|
186 |
$feed = new XML_Feed_Parser($content, false, true);
|
|
|
187 |
|
|
|
188 |
$this->assertEquals('Mark Pilgrim', $feed->publisher(0, 'name'));
|
|
|
189 |
}
|
|
|
190 |
|
|
|
191 |
function test_itunes_channel_subtitle_1() {
|
|
|
192 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/itunes/itunes_channel_subtitle.xml');
|
|
|
193 |
|
|
|
194 |
$feed = new XML_Feed_Parser($content, false, true);
|
|
|
195 |
|
|
|
196 |
$this->assertEquals('Example subtitle', $feed->subtitle);
|
|
|
197 |
}
|
|
|
198 |
|
|
|
199 |
function test_itunes_channel_summary_1() {
|
|
|
200 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/itunes/itunes_channel_summary.xml');
|
|
|
201 |
|
|
|
202 |
$feed = new XML_Feed_Parser($content, false, true);
|
|
|
203 |
|
|
|
204 |
$this->assertEquals('Example summary', $feed->description);
|
|
|
205 |
}
|
|
|
206 |
|
|
|
207 |
function test_itunes_core_element_uppercase_1() {
|
|
|
208 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/itunes/itunes_core_element_uppercase.xml');
|
|
|
209 |
|
|
|
210 |
$feed = new XML_Feed_Parser($content, false, true);
|
|
|
211 |
|
|
|
212 |
$this->assertEquals('Example title', $feed->title);
|
|
|
213 |
}
|
|
|
214 |
|
|
|
215 |
function test_itunes_enclosure_url_maps_id_1() {
|
|
|
216 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/itunes/itunes_enclosure_url_maps_id.xml');
|
|
|
217 |
|
|
|
218 |
$feed = new XML_Feed_Parser($content, false, true);
|
|
|
219 |
|
|
|
220 |
$this->assertEquals('http://example.com/movie.mp4', $feed->getEntryByOffset(0)->id);
|
|
|
221 |
}
|
|
|
222 |
|
|
|
223 |
function test_itunes_enclosure_url_maps_id_2_1() {
|
|
|
224 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/itunes/itunes_enclosure_url_maps_id_2.xml');
|
|
|
225 |
|
|
|
226 |
$feed = new XML_Feed_Parser($content, false, true);
|
|
|
227 |
|
|
|
228 |
$this->assertEquals('http://example.com/id', $feed->getEntryByOffset(0)->id);
|
|
|
229 |
}
|
|
|
230 |
|
|
|
231 |
function test_itunes_item_author_map_author_1() {
|
|
|
232 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/itunes/itunes_item_author_map_author.xml');
|
|
|
233 |
|
|
|
234 |
$feed = new XML_Feed_Parser($content, false, true);
|
|
|
235 |
|
|
|
236 |
$this->assertEquals('Mark Pilgrim', $feed->getEntryByOffset(0)->author);
|
|
|
237 |
}
|
|
|
238 |
|
|
|
239 |
function test_itunes_item_block_1() {
|
|
|
240 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/itunes/itunes_item_block.xml');
|
|
|
241 |
|
|
|
242 |
$feed = new XML_Feed_Parser($content, false, true);
|
|
|
243 |
|
|
|
244 |
$this->assertEquals(1, $feed->getEntryByOffset(0)->itunes_block);
|
|
|
245 |
}
|
|
|
246 |
|
|
|
247 |
function test_itunes_item_block_false_1() {
|
|
|
248 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/itunes/itunes_item_block_false.xml');
|
|
|
249 |
|
|
|
250 |
$feed = new XML_Feed_Parser($content, false, true);
|
|
|
251 |
|
|
|
252 |
$this->assertEquals(0, $feed->getEntryByOffset(0)->itunes_block);
|
|
|
253 |
}
|
|
|
254 |
|
|
|
255 |
function test_itunes_item_block_no_1() {
|
|
|
256 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/itunes/itunes_item_block_no.xml');
|
|
|
257 |
|
|
|
258 |
$feed = new XML_Feed_Parser($content, false, true);
|
|
|
259 |
|
|
|
260 |
$this->assertEquals(0, $feed->getEntryByOffset(0)->itunes_block);
|
|
|
261 |
}
|
|
|
262 |
|
|
|
263 |
function test_itunes_item_block_true_1() {
|
|
|
264 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/itunes/itunes_item_block_true.xml');
|
|
|
265 |
|
|
|
266 |
$feed = new XML_Feed_Parser($content, false, true);
|
|
|
267 |
|
|
|
268 |
$this->assertEquals(0, $feed->getEntryByOffset(0)->itunes_block);
|
|
|
269 |
}
|
|
|
270 |
|
|
|
271 |
function test_itunes_item_block_uppercase_1() {
|
|
|
272 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/itunes/itunes_item_block_uppercase.xml');
|
|
|
273 |
|
|
|
274 |
$feed = new XML_Feed_Parser($content, false, true);
|
|
|
275 |
|
|
|
276 |
$this->assertEquals(0, $feed->getEntryByOffset(0)->itunes_block);
|
|
|
277 |
}
|
|
|
278 |
|
|
|
279 |
function test_itunes_item_block_whitespace_1() {
|
|
|
280 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/itunes/itunes_item_block_whitespace.xml');
|
|
|
281 |
|
|
|
282 |
$feed = new XML_Feed_Parser($content, false, true);
|
|
|
283 |
|
|
|
284 |
$this->assertEquals(0, $feed->getEntryByOffset(0)->itunes_block);
|
|
|
285 |
}
|
|
|
286 |
|
|
|
287 |
function test_itunes_item_category_1() {
|
|
|
288 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/itunes/itunes_item_category.xml');
|
|
|
289 |
|
|
|
290 |
$feed = new XML_Feed_Parser($content, false, true);
|
|
|
291 |
|
|
|
292 |
$this->assertEquals('Technology', $feed->getEntryByOffset(0)->tags(0, 'term'));
|
|
|
293 |
}
|
|
|
294 |
|
|
|
295 |
function test_itunes_item_category_nested_1() {
|
|
|
296 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/itunes/itunes_item_category_nested.xml');
|
|
|
297 |
|
|
|
298 |
$feed = new XML_Feed_Parser($content, false, true);
|
|
|
299 |
|
|
|
300 |
$this->assertEquals('Gadgets', $feed->getEntryByOffset(0)->tags(0, 'term'));
|
|
|
301 |
}
|
|
|
302 |
|
|
|
303 |
function test_itunes_item_category_scheme_1() {
|
|
|
304 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/itunes/itunes_item_category_scheme.xml');
|
|
|
305 |
|
|
|
306 |
$feed = new XML_Feed_Parser($content, false, true);
|
|
|
307 |
|
|
|
308 |
$this->assertEquals('http://www.itunes.com/', $feed->getEntryByOffset(0)->tags(0, 'scheme'));
|
|
|
309 |
}
|
|
|
310 |
|
|
|
311 |
function test_itunes_item_duration_1() {
|
|
|
312 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/itunes/itunes_item_duration.xml');
|
|
|
313 |
|
|
|
314 |
$feed = new XML_Feed_Parser($content, false, true);
|
|
|
315 |
|
|
|
316 |
$this->assertEquals('3:00', $feed->getEntryByOffset(0)->itunes_duration);
|
|
|
317 |
}
|
|
|
318 |
|
|
|
319 |
function test_itunes_item_explicit_1() {
|
|
|
320 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/itunes/itunes_item_explicit.xml');
|
|
|
321 |
|
|
|
322 |
$feed = new XML_Feed_Parser($content, false, true);
|
|
|
323 |
|
|
|
324 |
$this->assertEquals(1, $feed->getEntryByOffset(0)->itunes_explicit);
|
|
|
325 |
}
|
|
|
326 |
|
|
|
327 |
function test_itunes_item_explicit_false_1() {
|
|
|
328 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/itunes/itunes_item_explicit_false.xml');
|
|
|
329 |
|
|
|
330 |
$feed = new XML_Feed_Parser($content, false, true);
|
|
|
331 |
|
|
|
332 |
$this->assertEquals(0, $feed->getEntryByOffset(0)->itunes_explicit);
|
|
|
333 |
}
|
|
|
334 |
|
|
|
335 |
function test_itunes_item_explicit_no_1() {
|
|
|
336 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/itunes/itunes_item_explicit_no.xml');
|
|
|
337 |
|
|
|
338 |
$feed = new XML_Feed_Parser($content, false, true);
|
|
|
339 |
|
|
|
340 |
$this->assertEquals(0, $feed->getEntryByOffset(0)->itunes_explicit);
|
|
|
341 |
}
|
|
|
342 |
|
|
|
343 |
function test_itunes_item_explicit_true_1() {
|
|
|
344 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/itunes/itunes_item_explicit_true.xml');
|
|
|
345 |
|
|
|
346 |
$feed = new XML_Feed_Parser($content, false, true);
|
|
|
347 |
|
|
|
348 |
$this->assertEquals(0, $feed->getEntryByOffset(0)->itunes_explicit);
|
|
|
349 |
}
|
|
|
350 |
|
|
|
351 |
function test_itunes_item_explicit_uppercase_1() {
|
|
|
352 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/itunes/itunes_item_explicit_uppercase.xml');
|
|
|
353 |
|
|
|
354 |
$feed = new XML_Feed_Parser($content, false, true);
|
|
|
355 |
|
|
|
356 |
$this->assertEquals(0, $feed->getEntryByOffset(0)->itunes_explicit);
|
|
|
357 |
}
|
|
|
358 |
|
|
|
359 |
function test_itunes_item_explicit_whitespace_1() {
|
|
|
360 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/itunes/itunes_item_explicit_whitespace.xml');
|
|
|
361 |
|
|
|
362 |
$feed = new XML_Feed_Parser($content, false, true);
|
|
|
363 |
|
|
|
364 |
$this->assertEquals(0, $feed->getEntryByOffset(0)->itunes_explicit);
|
|
|
365 |
}
|
|
|
366 |
|
|
|
367 |
function test_itunes_item_image_1() {
|
|
|
368 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/itunes/itunes_item_image.xml');
|
|
|
369 |
|
|
|
370 |
$feed = new XML_Feed_Parser($content, false, true);
|
|
|
371 |
|
|
|
372 |
$this->assertEquals('http://example.com/logo.jpg', $feed->getEntryByOffset(0)->image(0, 'href'));
|
|
|
373 |
}
|
|
|
374 |
|
|
|
375 |
function test_itunes_item_link_image_1() {
|
|
|
376 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/itunes/itunes_item_link_image.xml');
|
|
|
377 |
|
|
|
378 |
$feed = new XML_Feed_Parser($content, false, true);
|
|
|
379 |
|
|
|
380 |
$this->assertEquals('http://example.com/logo.jpg', $feed->getEntryByOffset(0)->image(0, 'href'));
|
|
|
381 |
}
|
|
|
382 |
|
|
|
383 |
function test_itunes_item_subtitle_1() {
|
|
|
384 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/itunes/itunes_item_subtitle.xml');
|
|
|
385 |
|
|
|
386 |
$feed = new XML_Feed_Parser($content, false, true);
|
|
|
387 |
|
|
|
388 |
$this->assertEquals('Example subtitle', $feed->getEntryByOffset(0)->subtitle);
|
|
|
389 |
}
|
|
|
390 |
|
|
|
391 |
function test_itunes_item_summary_1() {
|
|
|
392 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/itunes/itunes_item_summary.xml');
|
|
|
393 |
|
|
|
394 |
$feed = new XML_Feed_Parser($content, false, true);
|
|
|
395 |
|
|
|
396 |
$this->assertEquals('Example summary', $feed->getEntryByOffset(0)->summary);
|
|
|
397 |
}
|
|
|
398 |
|
|
|
399 |
function test_itunes_link_enclosure_maps_id_1() {
|
|
|
400 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/itunes/itunes_link_enclosure_maps_id.xml');
|
|
|
401 |
|
|
|
402 |
$feed = new XML_Feed_Parser($content, false, true);
|
|
|
403 |
|
|
|
404 |
$this->assertEquals('http://example.com/movie.mp4', $feed->getEntryByOffset(0)->id);
|
|
|
405 |
}
|
|
|
406 |
|
|
|
407 |
function test_itunes_link_enclosure_maps_id_2_1() {
|
|
|
408 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/itunes/itunes_link_enclosure_maps_id_2.xml');
|
|
|
409 |
|
|
|
410 |
$feed = new XML_Feed_Parser($content, false, true);
|
|
|
411 |
|
|
|
412 |
$this->assertEquals('http://example.com/id', $feed->getEntryByOffset(0)->id);
|
|
|
413 |
}
|
|
|
414 |
|
|
|
415 |
function test_itunes_namespace_1() {
|
|
|
416 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/itunes/itunes_namespace.xml');
|
|
|
417 |
|
|
|
418 |
$feed = new XML_Feed_Parser($content, false, true);
|
|
|
419 |
|
|
|
420 |
$this->assertEquals(1, $feed->itunes_block);
|
|
|
421 |
}
|
|
|
422 |
|
|
|
423 |
function test_itunes_namespace_example_1() {
|
|
|
424 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/itunes/itunes_namespace_example.xml');
|
|
|
425 |
|
|
|
426 |
$feed = new XML_Feed_Parser($content, false, true);
|
|
|
427 |
|
|
|
428 |
$this->assertEquals(1, $feed->itunes_block);
|
|
|
429 |
}
|
|
|
430 |
|
|
|
431 |
function test_itunes_namespace_lowercase_1() {
|
|
|
432 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/itunes/itunes_namespace_lowercase.xml');
|
|
|
433 |
|
|
|
434 |
$feed = new XML_Feed_Parser($content, false, true);
|
|
|
435 |
|
|
|
436 |
$this->assertEquals(1, $feed->itunes_block);
|
|
|
437 |
}
|
|
|
438 |
|
|
|
439 |
function test_itunes_namespace_uppercase_1() {
|
|
|
440 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/itunes/itunes_namespace_uppercase.xml');
|
|
|
441 |
|
|
|
442 |
$feed = new XML_Feed_Parser($content, false, true);
|
|
|
443 |
|
|
|
444 |
$this->assertEquals(1, $feed->itunes_block);
|
|
|
445 |
}
|
|
|
446 |
}
|
|
|
447 |
|
|
|
448 |
?>
|