1 |
41cc1b08
|
Assos Assos
|
<?php
|
2 |
|
|
|
3 |
|
|
class SimplePie_Unit_Test2_Group extends Unit_Test2_Group {}
|
4 |
|
|
|
5 |
|
|
class SimplePie_Unit_Test2 extends Unit_Test2 {}
|
6 |
|
|
|
7 |
|
|
class SimplePie_Feed_Test extends SimplePie_Unit_Test2
|
8 |
|
|
{
|
9 |
|
|
function feed()
|
10 |
|
|
{
|
11 |
|
|
$feed = new SimplePie();
|
12 |
|
|
$feed->set_raw_data($this->data);
|
13 |
|
|
$feed->enable_cache(false);
|
14 |
|
|
$feed->init();
|
15 |
|
|
return $feed;
|
16 |
|
|
}
|
17 |
|
|
}
|
18 |
|
|
|
19 |
|
|
class SimplePie_Feed_Author_Test extends SimplePie_Feed_Test
|
20 |
|
|
{
|
21 |
|
|
function author()
|
22 |
|
|
{
|
23 |
|
|
$feed = $this->feed();
|
24 |
|
|
if ($author = $item->get_author())
|
25 |
|
|
{
|
26 |
|
|
return $author;
|
27 |
|
|
}
|
28 |
|
|
else
|
29 |
|
|
{
|
30 |
|
|
return false;
|
31 |
|
|
}
|
32 |
|
|
}
|
33 |
|
|
}
|
34 |
|
|
|
35 |
|
|
class SimplePie_Feed_Category_Test extends SimplePie_Feed_Test
|
36 |
|
|
{
|
37 |
|
|
function category()
|
38 |
|
|
{
|
39 |
|
|
$feed = $this->feed();
|
40 |
|
|
if ($category = $feed->get_category())
|
41 |
|
|
{
|
42 |
|
|
return $category;
|
43 |
|
|
}
|
44 |
|
|
else
|
45 |
|
|
{
|
46 |
|
|
return false;
|
47 |
|
|
}
|
48 |
|
|
}
|
49 |
|
|
}
|
50 |
|
|
|
51 |
|
|
class SimplePie_First_Item_Test extends SimplePie_Feed_Test
|
52 |
|
|
{
|
53 |
|
|
function first_item()
|
54 |
|
|
{
|
55 |
|
|
$feed = $this->feed();
|
56 |
|
|
if ($item = $feed->get_item(0))
|
57 |
|
|
{
|
58 |
|
|
return $item;
|
59 |
|
|
}
|
60 |
|
|
else
|
61 |
|
|
{
|
62 |
|
|
return false;
|
63 |
|
|
}
|
64 |
|
|
}
|
65 |
|
|
}
|
66 |
|
|
|
67 |
|
|
class SimplePie_First_Item_Author_Test extends SimplePie_First_Item_Test
|
68 |
|
|
{
|
69 |
|
|
function author()
|
70 |
|
|
{
|
71 |
|
|
if ($item = $this->first_item())
|
72 |
|
|
{
|
73 |
|
|
if ($author = $item->get_author())
|
74 |
|
|
{
|
75 |
|
|
return $author;
|
76 |
|
|
}
|
77 |
|
|
}
|
78 |
|
|
return false;
|
79 |
|
|
}
|
80 |
|
|
}
|
81 |
|
|
|
82 |
|
|
class SimplePie_First_Item_Category_Test extends SimplePie_First_Item_Test
|
83 |
|
|
{
|
84 |
|
|
function category()
|
85 |
|
|
{
|
86 |
|
|
if ($item = $this->first_item())
|
87 |
|
|
{
|
88 |
|
|
if ($category = $item->get_category())
|
89 |
|
|
{
|
90 |
|
|
return $category;
|
91 |
|
|
}
|
92 |
|
|
}
|
93 |
|
|
return false;
|
94 |
|
|
}
|
95 |
|
|
}
|
96 |
|
|
|
97 |
|
|
class SimplePie_First_Item_Contributor_Test extends SimplePie_First_Item_Test
|
98 |
|
|
{
|
99 |
|
|
function contributor()
|
100 |
|
|
{
|
101 |
|
|
if ($item = $this->first_item())
|
102 |
|
|
{
|
103 |
|
|
if ($contributor = $item->get_contributor())
|
104 |
|
|
{
|
105 |
|
|
return $contributor;
|
106 |
|
|
}
|
107 |
|
|
}
|
108 |
|
|
return false;
|
109 |
|
|
}
|
110 |
|
|
}
|
111 |
|
|
|
112 |
|
|
class SimplePie_Absolutize_Test extends SimplePie_Unit_Test2
|
113 |
|
|
{
|
114 |
|
|
function test()
|
115 |
|
|
{
|
116 |
|
|
$this->result = SimplePie_Misc::absolutize_url($this->data['relative'], $this->data['base']);
|
117 |
|
|
}
|
118 |
|
|
}
|
119 |
|
|
|
120 |
|
|
class SimplePie_Date_Test extends SimplePie_Unit_Test2
|
121 |
|
|
{
|
122 |
|
|
function test()
|
123 |
|
|
{
|
124 |
|
|
$this->result = SimplePie_Misc::parse_date($this->data);
|
125 |
|
|
}
|
126 |
|
|
}
|
127 |
|
|
|
128 |
|
|
class SimplePie_Feed_Category_Label_Test extends SimplePie_Feed_Category_Test
|
129 |
|
|
{
|
130 |
|
|
function test()
|
131 |
|
|
{
|
132 |
|
|
if ($category = $this->category())
|
133 |
|
|
{
|
134 |
|
|
$this->result = $category->get_label();
|
135 |
|
|
}
|
136 |
|
|
}
|
137 |
|
|
}
|
138 |
|
|
|
139 |
|
|
class SimplePie_Feed_Copyright_Test extends SimplePie_Feed_Test
|
140 |
|
|
{
|
141 |
|
|
function test()
|
142 |
|
|
{
|
143 |
|
|
$feed = $this->feed();
|
144 |
|
|
$this->result = $feed->get_copyright();
|
145 |
|
|
}
|
146 |
|
|
}
|
147 |
|
|
|
148 |
|
|
class SimplePie_Feed_Description_Test extends SimplePie_Feed_Test
|
149 |
|
|
{
|
150 |
|
|
function test()
|
151 |
|
|
{
|
152 |
|
|
$feed = $this->feed();
|
153 |
|
|
$this->result = $feed->get_description();
|
154 |
|
|
}
|
155 |
|
|
}
|
156 |
|
|
|
157 |
|
|
class SimplePie_Feed_Image_Height_Test extends SimplePie_Feed_Test
|
158 |
|
|
{
|
159 |
|
|
function test()
|
160 |
|
|
{
|
161 |
|
|
$feed = $this->feed();
|
162 |
|
|
$this->result = $feed->get_image_height();
|
163 |
|
|
}
|
164 |
|
|
}
|
165 |
|
|
|
166 |
|
|
class SimplePie_Feed_Image_Link_Test extends SimplePie_Feed_Test
|
167 |
|
|
{
|
168 |
|
|
function test()
|
169 |
|
|
{
|
170 |
|
|
$feed = $this->feed();
|
171 |
|
|
$this->result = $feed->get_image_link();
|
172 |
|
|
}
|
173 |
|
|
}
|
174 |
|
|
|
175 |
|
|
class SimplePie_Feed_Image_Title_Test extends SimplePie_Feed_Test
|
176 |
|
|
{
|
177 |
|
|
function test()
|
178 |
|
|
{
|
179 |
|
|
$feed = $this->feed();
|
180 |
|
|
$this->result = $feed->get_image_title();
|
181 |
|
|
}
|
182 |
|
|
}
|
183 |
|
|
|
184 |
|
|
class SimplePie_Feed_Image_URL_Test extends SimplePie_Feed_Test
|
185 |
|
|
{
|
186 |
|
|
function test()
|
187 |
|
|
{
|
188 |
|
|
$feed = $this->feed();
|
189 |
|
|
$this->result = $feed->get_image_url();
|
190 |
|
|
}
|
191 |
|
|
}
|
192 |
|
|
|
193 |
|
|
class SimplePie_Feed_Image_Width_Test extends SimplePie_Feed_Test
|
194 |
|
|
{
|
195 |
|
|
function test()
|
196 |
|
|
{
|
197 |
|
|
$feed = $this->feed();
|
198 |
|
|
$this->result = $feed->get_image_width();
|
199 |
|
|
}
|
200 |
|
|
}
|
201 |
|
|
|
202 |
|
|
class SimplePie_Feed_Language_Test extends SimplePie_Feed_Test
|
203 |
|
|
{
|
204 |
|
|
function test()
|
205 |
|
|
{
|
206 |
|
|
$feed = $this->feed();
|
207 |
|
|
$this->result = $feed->get_language();
|
208 |
|
|
}
|
209 |
|
|
}
|
210 |
|
|
|
211 |
|
|
class SimplePie_Feed_Link_Test extends SimplePie_Feed_Test
|
212 |
|
|
{
|
213 |
|
|
function test()
|
214 |
|
|
{
|
215 |
|
|
$feed = $this->feed();
|
216 |
|
|
$this->result = $feed->get_link();
|
217 |
|
|
}
|
218 |
|
|
}
|
219 |
|
|
|
220 |
|
|
class SimplePie_Feed_Title_Test extends SimplePie_Feed_Test
|
221 |
|
|
{
|
222 |
|
|
function test()
|
223 |
|
|
{
|
224 |
|
|
$feed = $this->feed();
|
225 |
|
|
$this->result = $feed->get_title();
|
226 |
|
|
}
|
227 |
|
|
}
|
228 |
|
|
|
229 |
|
|
class SimplePie_First_Item_Author_Name_Test extends SimplePie_First_Item_Author_Test
|
230 |
|
|
{
|
231 |
|
|
function test()
|
232 |
|
|
{
|
233 |
|
|
if ($author = $this->author())
|
234 |
|
|
{
|
235 |
|
|
$this->result = $author->get_name();
|
236 |
|
|
}
|
237 |
|
|
}
|
238 |
|
|
}
|
239 |
|
|
|
240 |
|
|
class SimplePie_First_Item_Category_Label_Test extends SimplePie_First_Item_Category_Test
|
241 |
|
|
{
|
242 |
|
|
function test()
|
243 |
|
|
{
|
244 |
|
|
if ($category = $this->category())
|
245 |
|
|
{
|
246 |
|
|
$this->result = $category->get_label();
|
247 |
|
|
}
|
248 |
|
|
}
|
249 |
|
|
}
|
250 |
|
|
|
251 |
|
|
class SimplePie_First_Item_Content_Test extends SimplePie_First_Item_Test
|
252 |
|
|
{
|
253 |
|
|
function test()
|
254 |
|
|
{
|
255 |
|
|
if ($item = $this->first_item())
|
256 |
|
|
{
|
257 |
|
|
$this->result = $item->get_content();
|
258 |
|
|
}
|
259 |
|
|
}
|
260 |
|
|
}
|
261 |
|
|
|
262 |
|
|
class SimplePie_First_Item_Contributor_Name_Test extends SimplePie_First_Item_Contributor_Test
|
263 |
|
|
{
|
264 |
|
|
function test()
|
265 |
|
|
{
|
266 |
|
|
if ($contributor = $this->contributor())
|
267 |
|
|
{
|
268 |
|
|
$this->result = $contributor->get_name();
|
269 |
|
|
}
|
270 |
|
|
}
|
271 |
|
|
}
|
272 |
|
|
|
273 |
|
|
class SimplePie_First_Item_Date_Test extends SimplePie_First_Item_Test
|
274 |
|
|
{
|
275 |
|
|
function test()
|
276 |
|
|
{
|
277 |
|
|
if ($item = $this->first_item())
|
278 |
|
|
{
|
279 |
|
|
$this->result = $item->get_date('U');
|
280 |
|
|
}
|
281 |
|
|
}
|
282 |
|
|
}
|
283 |
|
|
|
284 |
|
|
class SimplePie_First_Item_Description_Test extends SimplePie_First_Item_Test
|
285 |
|
|
{
|
286 |
|
|
function test()
|
287 |
|
|
{
|
288 |
|
|
if ($item = $this->first_item())
|
289 |
|
|
{
|
290 |
|
|
$this->result = $item->get_description();
|
291 |
|
|
}
|
292 |
|
|
}
|
293 |
|
|
}
|
294 |
|
|
|
295 |
|
|
class SimplePie_First_Item_ID_Test extends SimplePie_First_Item_Test
|
296 |
|
|
{
|
297 |
|
|
function test()
|
298 |
|
|
{
|
299 |
|
|
if ($item = $this->first_item())
|
300 |
|
|
{
|
301 |
|
|
$this->result = $item->get_id();
|
302 |
|
|
}
|
303 |
|
|
}
|
304 |
|
|
}
|
305 |
|
|
|
306 |
|
|
class SimplePie_First_Item_Latitude_Test extends SimplePie_First_Item_Test
|
307 |
|
|
{
|
308 |
|
|
function test()
|
309 |
|
|
{
|
310 |
|
|
if ($item = $this->first_item())
|
311 |
|
|
{
|
312 |
|
|
$this->result = $item->get_latitude();
|
313 |
|
|
}
|
314 |
|
|
}
|
315 |
|
|
}
|
316 |
|
|
|
317 |
|
|
class SimplePie_First_Item_Longitude_Test extends SimplePie_First_Item_Test
|
318 |
|
|
{
|
319 |
|
|
function test()
|
320 |
|
|
{
|
321 |
|
|
if ($item = $this->first_item())
|
322 |
|
|
{
|
323 |
|
|
$this->result = $item->get_longitude();
|
324 |
|
|
}
|
325 |
|
|
}
|
326 |
|
|
}
|
327 |
|
|
|
328 |
|
|
class SimplePie_First_Item_Permalink_Test extends SimplePie_First_Item_Test
|
329 |
|
|
{
|
330 |
|
|
function test()
|
331 |
|
|
{
|
332 |
|
|
if ($item = $this->first_item())
|
333 |
|
|
{
|
334 |
|
|
$this->result = $item->get_permalink();
|
335 |
|
|
}
|
336 |
|
|
}
|
337 |
|
|
}
|
338 |
|
|
|
339 |
|
|
class SimplePie_First_Item_Title_Test extends SimplePie_First_Item_Test
|
340 |
|
|
{
|
341 |
|
|
function test()
|
342 |
|
|
{
|
343 |
|
|
if ($item = $this->first_item())
|
344 |
|
|
{
|
345 |
|
|
$this->result = $item->get_title();
|
346 |
|
|
}
|
347 |
|
|
}
|
348 |
|
|
}
|
349 |
|
|
|
350 |
|
|
class SimplePie_iTunesRSS_Channel_Block_Test extends SimplePie_First_Item_Test
|
351 |
|
|
{
|
352 |
|
|
function test()
|
353 |
|
|
{
|
354 |
|
|
if ($item = $this->first_item())
|
355 |
|
|
{
|
356 |
|
|
if ($enclosure = $item->get_enclosure())
|
357 |
|
|
{
|
358 |
|
|
if ($restriction = $enclosure->get_restriction())
|
359 |
|
|
{
|
360 |
|
|
$this->result = $restriction->get_relationship();
|
361 |
|
|
return;
|
362 |
|
|
}
|
363 |
|
|
}
|
364 |
|
|
}
|
365 |
|
|
$this->result = false;
|
366 |
|
|
}
|
367 |
|
|
}
|
368 |
|
|
|
369 |
|
|
?> |