/tests/ZendTest/Feed/Reader/Feed/RssTest.php

https://github.com/zucchi/zf2 · PHP · 1438 lines · 1213 code · 178 blank · 47 comment · 0 complexity · 85df705b755838510801b8910fe887d4 MD5 · raw file

  1. <?php
  2. /**
  3. * Zend Framework (http://framework.zend.com/)
  4. *
  5. * @link http://github.com/zendframework/zf2 for the canonical source repository
  6. * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
  7. * @license http://framework.zend.com/license/new-bsd New BSD License
  8. * @package Zend_Feed
  9. */
  10. namespace ZendTest\Feed\Reader\Feed;
  11. use DateTime;
  12. use Zend\Feed\Reader;
  13. /**
  14. * @category Zend
  15. * @package Zend_Feed
  16. * @subpackage UnitTests
  17. * @group Zend_Feed
  18. * @group Zend_Feed_Reader
  19. */
  20. class RssTest extends \PHPUnit_Framework_TestCase
  21. {
  22. protected $feedSamplePath = null;
  23. protected $expectedCats = array();
  24. protected $expectedCatsRdf = array();
  25. protected $expectedCatsAtom = array();
  26. public function setup()
  27. {
  28. Reader\Reader::reset();
  29. $this->feedSamplePath = dirname(__FILE__) . '/_files/Rss';
  30. $this->expectedCats = array(
  31. array(
  32. 'term' => 'topic1',
  33. 'scheme' => 'http://example.com/schema1',
  34. 'label' => 'topic1'
  35. ),
  36. array(
  37. 'term' => 'topic1',
  38. 'scheme' => 'http://example.com/schema2',
  39. 'label' => 'topic1'
  40. ),
  41. array(
  42. 'term' => 'topic2',
  43. 'scheme' => 'http://example.com/schema1',
  44. 'label' => 'topic2'
  45. )
  46. );
  47. $this->expectedCatsRdf = array(
  48. array(
  49. 'term' => 'topic1',
  50. 'scheme' => null,
  51. 'label' => 'topic1'
  52. ),
  53. array(
  54. 'term' => 'topic2',
  55. 'scheme' => null,
  56. 'label' => 'topic2'
  57. )
  58. );
  59. $this->expectedCatsAtom = array(
  60. array(
  61. 'term' => 'topic1',
  62. 'scheme' => 'http://example.com/schema1',
  63. 'label' => 'topic1'
  64. ),
  65. array(
  66. 'term' => 'topic1',
  67. 'scheme' => 'http://example.com/schema2',
  68. 'label' => 'topic1'
  69. ),
  70. array(
  71. 'term' => 'cat_dog',
  72. 'scheme' => 'http://example.com/schema1',
  73. 'label' => 'Cat & Dog'
  74. )
  75. );
  76. }
  77. /**
  78. * Get Title (Unencoded Text)
  79. */
  80. public function testGetsTitleFromRss20()
  81. {
  82. $feed = Reader\Reader::importString(
  83. file_get_contents($this->feedSamplePath.'/title/plain/rss20.xml')
  84. );
  85. $this->assertEquals('My Title', $feed->getTitle());
  86. }
  87. public function testGetsTitleFromRss094()
  88. {
  89. $feed = Reader\Reader::importString(
  90. file_get_contents($this->feedSamplePath.'/title/plain/rss094.xml')
  91. );
  92. $this->assertEquals('My Title', $feed->getTitle());
  93. }
  94. public function testGetsTitleFromRss093()
  95. {
  96. $feed = Reader\Reader::importString(
  97. file_get_contents($this->feedSamplePath.'/title/plain/rss093.xml')
  98. );
  99. $this->assertEquals('My Title', $feed->getTitle());
  100. }
  101. public function testGetsTitleFromRss092()
  102. {
  103. $feed = Reader\Reader::importString(
  104. file_get_contents($this->feedSamplePath.'/title/plain/rss092.xml')
  105. );
  106. $this->assertEquals('My Title', $feed->getTitle());
  107. }
  108. public function testGetsTitleFromRss091()
  109. {
  110. $feed = Reader\Reader::importString(
  111. file_get_contents($this->feedSamplePath.'/title/plain/rss091.xml')
  112. );
  113. $this->assertEquals('My Title', $feed->getTitle());
  114. }
  115. public function testGetsTitleFromRss10()
  116. {
  117. $feed = Reader\Reader::importString(
  118. file_get_contents($this->feedSamplePath.'/title/plain/rss10.xml')
  119. );
  120. $this->assertEquals('My Title', $feed->getTitle());
  121. }
  122. public function testGetsTitleFromRss090()
  123. {
  124. $feed = Reader\Reader::importString(
  125. file_get_contents($this->feedSamplePath.'/title/plain/rss090.xml')
  126. );
  127. $this->assertEquals('My Title', $feed->getTitle());
  128. }
  129. // DC 1.0
  130. public function testGetsTitleFromRss20_Dc10()
  131. {
  132. $feed = Reader\Reader::importString(
  133. file_get_contents($this->feedSamplePath.'/title/plain/dc10/rss20.xml')
  134. );
  135. $this->assertEquals('My Title', $feed->getTitle());
  136. }
  137. public function testGetsTitleFromRss094_Dc10()
  138. {
  139. $feed = Reader\Reader::importString(
  140. file_get_contents($this->feedSamplePath.'/title/plain/dc10/rss094.xml')
  141. );
  142. $this->assertEquals('My Title', $feed->getTitle());
  143. }
  144. public function testGetsTitleFromRss093_Dc10()
  145. {
  146. $feed = Reader\Reader::importString(
  147. file_get_contents($this->feedSamplePath.'/title/plain/dc10/rss093.xml')
  148. );
  149. $this->assertEquals('My Title', $feed->getTitle());
  150. }
  151. public function testGetsTitleFromRss092_Dc10()
  152. {
  153. $feed = Reader\Reader::importString(
  154. file_get_contents($this->feedSamplePath.'/title/plain/dc10/rss092.xml')
  155. );
  156. $this->assertEquals('My Title', $feed->getTitle());
  157. }
  158. public function testGetsTitleFromRss091_Dc10()
  159. {
  160. $feed = Reader\Reader::importString(
  161. file_get_contents($this->feedSamplePath.'/title/plain/dc10/rss091.xml')
  162. );
  163. $this->assertEquals('My Title', $feed->getTitle());
  164. }
  165. public function testGetsTitleFromRss10_Dc10()
  166. {
  167. $feed = Reader\Reader::importString(
  168. file_get_contents($this->feedSamplePath.'/title/plain/dc10/rss10.xml')
  169. );
  170. $this->assertEquals('My Title', $feed->getTitle());
  171. }
  172. public function testGetsTitleFromRss090_Dc10()
  173. {
  174. $feed = Reader\Reader::importString(
  175. file_get_contents($this->feedSamplePath.'/title/plain/dc10/rss090.xml')
  176. );
  177. $this->assertEquals('My Title', $feed->getTitle());
  178. }
  179. // DC 1.1
  180. public function testGetsTitleFromRss20_Dc11()
  181. {
  182. $feed = Reader\Reader::importString(
  183. file_get_contents($this->feedSamplePath.'/title/plain/dc11/rss20.xml')
  184. );
  185. $this->assertEquals('My Title', $feed->getTitle());
  186. }
  187. public function testGetsTitleFromRss094_Dc11()
  188. {
  189. $feed = Reader\Reader::importString(
  190. file_get_contents($this->feedSamplePath.'/title/plain/dc11/rss094.xml')
  191. );
  192. $this->assertEquals('My Title', $feed->getTitle());
  193. }
  194. public function testGetsTitleFromRss093_Dc11()
  195. {
  196. $feed = Reader\Reader::importString(
  197. file_get_contents($this->feedSamplePath.'/title/plain/dc11/rss093.xml')
  198. );
  199. $this->assertEquals('My Title', $feed->getTitle());
  200. }
  201. public function testGetsTitleFromRss092_Dc11()
  202. {
  203. $feed = Reader\Reader::importString(
  204. file_get_contents($this->feedSamplePath.'/title/plain/dc11/rss092.xml')
  205. );
  206. $this->assertEquals('My Title', $feed->getTitle());
  207. }
  208. public function testGetsTitleFromRss091_Dc11()
  209. {
  210. $feed = Reader\Reader::importString(
  211. file_get_contents($this->feedSamplePath.'/title/plain/dc11/rss091.xml')
  212. );
  213. $this->assertEquals('My Title', $feed->getTitle());
  214. }
  215. public function testGetsTitleFromRss10_Dc11()
  216. {
  217. $feed = Reader\Reader::importString(
  218. file_get_contents($this->feedSamplePath.'/title/plain/dc11/rss10.xml')
  219. );
  220. $this->assertEquals('My Title', $feed->getTitle());
  221. }
  222. public function testGetsTitleFromRss090_Dc11()
  223. {
  224. $feed = Reader\Reader::importString(
  225. file_get_contents($this->feedSamplePath.'/title/plain/dc11/rss090.xml')
  226. );
  227. $this->assertEquals('My Title', $feed->getTitle());
  228. }
  229. // Atom 1.0
  230. public function testGetsTitleFromRss20_atom10()
  231. {
  232. $feed = Reader\Reader::importString(
  233. file_get_contents($this->feedSamplePath.'/title/plain/atom10/rss20.xml')
  234. );
  235. $this->assertEquals('My Title', $feed->getTitle());
  236. }
  237. public function testGetsTitleFromRss094_atom10()
  238. {
  239. $feed = Reader\Reader::importString(
  240. file_get_contents($this->feedSamplePath.'/title/plain/atom10/rss094.xml')
  241. );
  242. $this->assertEquals('My Title', $feed->getTitle());
  243. }
  244. public function testGetsTitleFromRss093_atom10()
  245. {
  246. $feed = Reader\Reader::importString(
  247. file_get_contents($this->feedSamplePath.'/title/plain/atom10/rss093.xml')
  248. );
  249. $this->assertEquals('My Title', $feed->getTitle());
  250. }
  251. public function testGetsTitleFromRss092_atom10()
  252. {
  253. $feed = Reader\Reader::importString(
  254. file_get_contents($this->feedSamplePath.'/title/plain/atom10/rss092.xml')
  255. );
  256. $this->assertEquals('My Title', $feed->getTitle());
  257. }
  258. public function testGetsTitleFromRss091_atom10()
  259. {
  260. $feed = Reader\Reader::importString(
  261. file_get_contents($this->feedSamplePath.'/title/plain/atom10/rss091.xml')
  262. );
  263. $this->assertEquals('My Title', $feed->getTitle());
  264. }
  265. public function testGetsTitleFromRss10_atom10()
  266. {
  267. $feed = Reader\Reader::importString(
  268. file_get_contents($this->feedSamplePath.'/title/plain/atom10/rss10.xml')
  269. );
  270. $this->assertEquals('My Title', $feed->getTitle());
  271. }
  272. public function testGetsTitleFromRss090_atom10()
  273. {
  274. $feed = Reader\Reader::importString(
  275. file_get_contents($this->feedSamplePath.'/title/plain/atom10/rss090.xml')
  276. );
  277. $this->assertEquals('My Title', $feed->getTitle());
  278. }
  279. // Missing Title
  280. public function testGetsTitleFromRss20_None()
  281. {
  282. $feed = Reader\Reader::importString(
  283. file_get_contents($this->feedSamplePath.'/title/plain/none/rss20.xml')
  284. );
  285. $this->assertEquals(null, $feed->getTitle());
  286. }
  287. public function testGetsTitleFromRss094_None()
  288. {
  289. $feed = Reader\Reader::importString(
  290. file_get_contents($this->feedSamplePath.'/title/plain/none/rss094.xml')
  291. );
  292. $this->assertEquals(null, $feed->getTitle());
  293. }
  294. public function testGetsTitleFromRss093_None()
  295. {
  296. $feed = Reader\Reader::importString(
  297. file_get_contents($this->feedSamplePath.'/title/plain/none/rss093.xml')
  298. );
  299. $this->assertEquals(null, $feed->getTitle());
  300. }
  301. public function testGetsTitleFromRss092_None()
  302. {
  303. $feed = Reader\Reader::importString(
  304. file_get_contents($this->feedSamplePath.'/title/plain/none/rss092.xml')
  305. );
  306. $this->assertEquals(null, $feed->getTitle());
  307. }
  308. public function testGetsTitleFromRss091_None()
  309. {
  310. $feed = Reader\Reader::importString(
  311. file_get_contents($this->feedSamplePath.'/title/plain/none/rss091.xml')
  312. );
  313. $this->assertEquals(null, $feed->getTitle());
  314. }
  315. public function testGetsTitleFromRss10_None()
  316. {
  317. $feed = Reader\Reader::importString(
  318. file_get_contents($this->feedSamplePath.'/title/plain/none/rss10.xml')
  319. );
  320. $this->assertEquals(null, $feed->getTitle());
  321. }
  322. public function testGetsTitleFromRss090_None()
  323. {
  324. $feed = Reader\Reader::importString(
  325. file_get_contents($this->feedSamplePath.'/title/plain/none/rss090.xml')
  326. );
  327. $this->assertEquals(null, $feed->getTitle());
  328. }
  329. /**
  330. * Get Authors (Unencoded Text)
  331. */
  332. public function testGetsAuthorArrayFromRss20()
  333. {
  334. $feed = Reader\Reader::importString(
  335. file_get_contents($this->feedSamplePath.'/author/plain/rss20.xml')
  336. );
  337. $this->assertEquals(array(
  338. array('email'=>'joe@example.com','name'=>'Joe Bloggs'),
  339. array('email'=>'jane@example.com','name'=>'Jane Bloggs')
  340. ), (array) $feed->getAuthors());
  341. $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $feed->getAuthors()->getValues());
  342. }
  343. public function testGetsAuthorArrayFromRss094()
  344. {
  345. $feed = Reader\Reader::importString(
  346. file_get_contents($this->feedSamplePath.'/author/plain/rss094.xml')
  347. );
  348. $this->assertEquals(array(
  349. array('email'=>'joe@example.com','name'=>'Joe Bloggs'),
  350. array('email'=>'jane@example.com','name'=>'Jane Bloggs')
  351. ), (array) $feed->getAuthors());
  352. $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $feed->getAuthors()->getValues());
  353. }
  354. public function testGetsAuthorArrayFromRss093()
  355. {
  356. $feed = Reader\Reader::importString(
  357. file_get_contents($this->feedSamplePath.'/author/plain/rss093.xml')
  358. );
  359. $this->assertEquals(array(
  360. array('email'=>'joe@example.com','name'=>'Joe Bloggs'),
  361. array('email'=>'jane@example.com','name'=>'Jane Bloggs')
  362. ), (array) $feed->getAuthors());
  363. $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $feed->getAuthors()->getValues());
  364. }
  365. public function testGetsAuthorArrayFromRss092()
  366. {
  367. $feed = Reader\Reader::importString(
  368. file_get_contents($this->feedSamplePath.'/author/plain/rss092.xml')
  369. );
  370. $this->assertEquals(array(
  371. array('email'=>'joe@example.com','name'=>'Joe Bloggs'),
  372. array('email'=>'jane@example.com','name'=>'Jane Bloggs')
  373. ), (array) $feed->getAuthors());
  374. $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $feed->getAuthors()->getValues());
  375. }
  376. public function testGetsAuthorArrayFromRss091()
  377. {
  378. $feed = Reader\Reader::importString(
  379. file_get_contents($this->feedSamplePath.'/author/plain/rss091.xml')
  380. );
  381. $this->assertEquals(array(
  382. array('email'=>'joe@example.com','name'=>'Joe Bloggs'),
  383. array('email'=>'jane@example.com','name'=>'Jane Bloggs')
  384. ), (array) $feed->getAuthors());
  385. $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $feed->getAuthors()->getValues());
  386. }
  387. public function testGetsAuthorArrayFromRss10()
  388. {
  389. $feed = Reader\Reader::importString(
  390. file_get_contents($this->feedSamplePath.'/author/plain/rss10.xml')
  391. );
  392. $this->assertEquals(array(
  393. array('email'=>'joe@example.com','name'=>'Joe Bloggs'),
  394. array('email'=>'jane@example.com','name'=>'Jane Bloggs')
  395. ), (array) $feed->getAuthors());
  396. $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $feed->getAuthors()->getValues());
  397. }
  398. public function testGetsAuthorArrayFromRss090()
  399. {
  400. $feed = Reader\Reader::importString(
  401. file_get_contents($this->feedSamplePath.'/author/plain/rss090.xml')
  402. );
  403. $this->assertEquals(array(
  404. array('email'=>'joe@example.com','name'=>'Joe Bloggs'),
  405. array('email'=>'jane@example.com','name'=>'Jane Bloggs')
  406. ), (array) $feed->getAuthors());
  407. $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $feed->getAuthors()->getValues());
  408. }
  409. // DC 1.0
  410. public function testGetsAuthorArrayFromRss20_Dc10()
  411. {
  412. $feed = Reader\Reader::importString(
  413. file_get_contents($this->feedSamplePath.'/author/plain/dc10/rss20.xml')
  414. );
  415. $this->assertEquals(array(
  416. array('name'=>'Joe Bloggs'), array('name'=>'Jane Bloggs')
  417. ), (array) $feed->getAuthors());
  418. $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $feed->getAuthors()->getValues());
  419. }
  420. public function testGetsAuthorArrayFromRss094_Dc10()
  421. {
  422. $feed = Reader\Reader::importString(
  423. file_get_contents($this->feedSamplePath.'/author/plain/dc10/rss094.xml')
  424. );
  425. $this->assertEquals(array(
  426. array('name'=>'Joe Bloggs'), array('name'=>'Jane Bloggs')
  427. ), (array) $feed->getAuthors());
  428. $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $feed->getAuthors()->getValues());
  429. }
  430. public function testGetsAuthorArrayFromRss093_Dc10()
  431. {
  432. $feed = Reader\Reader::importString(
  433. file_get_contents($this->feedSamplePath.'/author/plain/dc10/rss093.xml')
  434. );
  435. $this->assertEquals(array(
  436. array('name'=>'Joe Bloggs'), array('name'=>'Jane Bloggs')
  437. ), (array) $feed->getAuthors());
  438. $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $feed->getAuthors()->getValues());
  439. }
  440. public function testGetsAuthorArrayFromRss092_Dc10()
  441. {
  442. $feed = Reader\Reader::importString(
  443. file_get_contents($this->feedSamplePath.'/author/plain/dc10/rss092.xml')
  444. );
  445. $this->assertEquals(array(
  446. array('name'=>'Joe Bloggs'), array('name'=>'Jane Bloggs')
  447. ), (array) $feed->getAuthors());
  448. $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $feed->getAuthors()->getValues());
  449. }
  450. public function testGetsAuthorArrayFromRss091_Dc10()
  451. {
  452. $feed = Reader\Reader::importString(
  453. file_get_contents($this->feedSamplePath.'/author/plain/dc10/rss091.xml')
  454. );
  455. $this->assertEquals(array(
  456. array('name'=>'Joe Bloggs'), array('name'=>'Jane Bloggs')
  457. ), (array) $feed->getAuthors());
  458. $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $feed->getAuthors()->getValues());
  459. }
  460. public function testGetsAuthorArrayFromRss10_Dc10()
  461. {
  462. $feed = Reader\Reader::importString(
  463. file_get_contents($this->feedSamplePath.'/author/plain/dc10/rss10.xml')
  464. );
  465. $this->assertEquals(array(
  466. array('name'=>'Joe Bloggs'), array('name'=>'Jane Bloggs')
  467. ), (array) $feed->getAuthors());
  468. $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $feed->getAuthors()->getValues());
  469. }
  470. public function testGetsAuthorArrayFromRss090_Dc10()
  471. {
  472. $feed = Reader\Reader::importString(
  473. file_get_contents($this->feedSamplePath.'/author/plain/dc10/rss090.xml')
  474. );
  475. $this->assertEquals(array(
  476. array('name'=>'Joe Bloggs'), array('name'=>'Jane Bloggs')
  477. ), (array) $feed->getAuthors());
  478. $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $feed->getAuthors()->getValues());
  479. }
  480. // DC 1.1
  481. public function testGetsAuthorArrayFromRss20_Dc11()
  482. {
  483. $feed = Reader\Reader::importString(
  484. file_get_contents($this->feedSamplePath.'/author/plain/dc11/rss20.xml')
  485. );
  486. $this->assertEquals(array(
  487. array('name'=>'Joe Bloggs'), array('name'=>'Jane Bloggs')
  488. ), (array) $feed->getAuthors());
  489. $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $feed->getAuthors()->getValues());
  490. }
  491. public function testGetsAuthorArrayFromRss094_Dc11()
  492. {
  493. $feed = Reader\Reader::importString(
  494. file_get_contents($this->feedSamplePath.'/author/plain/dc11/rss094.xml')
  495. );
  496. $this->assertEquals(array(
  497. array('name'=>'Joe Bloggs'), array('name'=>'Jane Bloggs')
  498. ), (array) $feed->getAuthors());
  499. $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $feed->getAuthors()->getValues());
  500. }
  501. public function testGetsAuthorArrayFromRss093_Dc11()
  502. {
  503. $feed = Reader\Reader::importString(
  504. file_get_contents($this->feedSamplePath.'/author/plain/dc11/rss093.xml')
  505. );
  506. $this->assertEquals(array(
  507. array('name'=>'Joe Bloggs'), array('name'=>'Jane Bloggs')
  508. ), (array) $feed->getAuthors());
  509. $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $feed->getAuthors()->getValues());
  510. }
  511. public function testGetsAuthorArrayFromRss092_Dc11()
  512. {
  513. $feed = Reader\Reader::importString(
  514. file_get_contents($this->feedSamplePath.'/author/plain/dc11/rss092.xml')
  515. );
  516. $this->assertEquals(array(
  517. array('name'=>'Joe Bloggs'), array('name'=>'Jane Bloggs')
  518. ), (array) $feed->getAuthors());
  519. $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $feed->getAuthors()->getValues());
  520. }
  521. public function testGetsAuthorArrayFromRss091_Dc11()
  522. {
  523. $feed = Reader\Reader::importString(
  524. file_get_contents($this->feedSamplePath.'/author/plain/dc11/rss091.xml')
  525. );
  526. $this->assertEquals(array(
  527. array('name'=>'Joe Bloggs'), array('name'=>'Jane Bloggs')
  528. ), (array) $feed->getAuthors());
  529. $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $feed->getAuthors()->getValues());
  530. }
  531. public function testGetsAuthorArrayFromRss10_Dc11()
  532. {
  533. $feed = Reader\Reader::importString(
  534. file_get_contents($this->feedSamplePath.'/author/plain/dc11/rss10.xml')
  535. );
  536. $this->assertEquals(array(
  537. array('name'=>'Joe Bloggs'), array('name'=>'Jane Bloggs')
  538. ), (array) $feed->getAuthors());
  539. $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $feed->getAuthors()->getValues());
  540. }
  541. public function testGetsAuthorArrayFromRss090_Dc11()
  542. {
  543. $feed = Reader\Reader::importString(
  544. file_get_contents($this->feedSamplePath.'/author/plain/dc11/rss090.xml')
  545. );
  546. $this->assertEquals(array(
  547. array('name'=>'Joe Bloggs'), array('name'=>'Jane Bloggs')
  548. ), (array) $feed->getAuthors());
  549. $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $feed->getAuthors()->getValues());
  550. }
  551. // Atom 1.0
  552. public function testGetsAuthorArrayFromRss20_Atom10()
  553. {
  554. $feed = Reader\Reader::importString(
  555. file_get_contents($this->feedSamplePath.'/author/plain/atom10/rss20.xml')
  556. );
  557. $this->assertEquals(array(
  558. array('name'=>'Joe Bloggs'), array('name'=>'Jane Bloggs')
  559. ), (array) $feed->getAuthors());
  560. $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $feed->getAuthors()->getValues());
  561. }
  562. public function testGetsAuthorArrayFromRss094_Atom10()
  563. {
  564. $feed = Reader\Reader::importString(
  565. file_get_contents($this->feedSamplePath.'/author/plain/atom10/rss094.xml')
  566. );
  567. $this->assertEquals(array(
  568. array('name'=>'Joe Bloggs'), array('name'=>'Jane Bloggs')
  569. ), (array) $feed->getAuthors());
  570. $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $feed->getAuthors()->getValues());
  571. }
  572. public function testGetsAuthorArrayFromRss093_Atom10()
  573. {
  574. $feed = Reader\Reader::importString(
  575. file_get_contents($this->feedSamplePath.'/author/plain/atom10/rss093.xml')
  576. );
  577. $this->assertEquals(array(
  578. array('name'=>'Joe Bloggs'), array('name'=>'Jane Bloggs')
  579. ), (array) $feed->getAuthors());
  580. $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $feed->getAuthors()->getValues());
  581. }
  582. public function testGetsAuthorArrayFromRss092_Atom10()
  583. {
  584. $feed = Reader\Reader::importString(
  585. file_get_contents($this->feedSamplePath.'/author/plain/atom10/rss092.xml')
  586. );
  587. $this->assertEquals(array(
  588. array('name'=>'Joe Bloggs'), array('name'=>'Jane Bloggs')
  589. ), (array) $feed->getAuthors());
  590. $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $feed->getAuthors()->getValues());
  591. }
  592. public function testGetsAuthorArrayFromRss091_Atom10()
  593. {
  594. $feed = Reader\Reader::importString(
  595. file_get_contents($this->feedSamplePath.'/author/plain/atom10/rss091.xml')
  596. );
  597. $this->assertEquals(array(
  598. array('name'=>'Joe Bloggs'), array('name'=>'Jane Bloggs')
  599. ), (array) $feed->getAuthors());
  600. $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $feed->getAuthors()->getValues());
  601. }
  602. public function testGetsAuthorArrayFromRss10_Atom10()
  603. {
  604. $feed = Reader\Reader::importString(
  605. file_get_contents($this->feedSamplePath.'/author/plain/atom10/rss10.xml')
  606. );
  607. $this->assertEquals(array(
  608. array('name'=>'Joe Bloggs'), array('name'=>'Jane Bloggs')
  609. ), (array) $feed->getAuthors());
  610. $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $feed->getAuthors()->getValues());
  611. }
  612. public function testGetsAuthorArrayFromRss090_Atom10()
  613. {
  614. $feed = Reader\Reader::importString(
  615. file_get_contents($this->feedSamplePath.'/author/plain/atom10/rss090.xml')
  616. );
  617. $this->assertEquals(array(
  618. array('name'=>'Joe Bloggs'), array('name'=>'Jane Bloggs')
  619. ), (array) $feed->getAuthors());
  620. $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $feed->getAuthors()->getValues());
  621. }
  622. // Missing Authors
  623. public function testGetsAuthorArrayFromRss20_None()
  624. {
  625. $feed = Reader\Reader::importString(
  626. file_get_contents($this->feedSamplePath.'/author/plain/none/rss20.xml')
  627. );
  628. $this->assertEquals(null, $feed->getAuthors());
  629. }
  630. public function testGetsAuthorArrayFromRss094_None()
  631. {
  632. $feed = Reader\Reader::importString(
  633. file_get_contents($this->feedSamplePath.'/author/plain/none/rss094.xml')
  634. );
  635. $this->assertEquals(null, $feed->getAuthors());
  636. }
  637. public function testGetsAuthorArrayFromRss093_None()
  638. {
  639. $feed = Reader\Reader::importString(
  640. file_get_contents($this->feedSamplePath.'/author/plain/none/rss093.xml')
  641. );
  642. $this->assertEquals(null, $feed->getAuthors());
  643. }
  644. public function testGetsAuthorArrayFromRss092_None()
  645. {
  646. $feed = Reader\Reader::importString(
  647. file_get_contents($this->feedSamplePath.'/author/plain/none/rss092.xml')
  648. );
  649. $this->assertEquals(null, $feed->getAuthors());
  650. }
  651. public function testGetsAuthorArrayFromRss091_None()
  652. {
  653. $feed = Reader\Reader::importString(
  654. file_get_contents($this->feedSamplePath.'/author/plain/none/rss091.xml')
  655. );
  656. $this->assertEquals(null, $feed->getAuthors());
  657. }
  658. public function testGetsAuthorArrayFromRss10_None()
  659. {
  660. $feed = Reader\Reader::importString(
  661. file_get_contents($this->feedSamplePath.'/author/plain/none/rss10.xml')
  662. );
  663. $this->assertEquals(null, $feed->getAuthors());
  664. }
  665. public function testGetsAuthorArrayFromRss090_None()
  666. {
  667. $feed = Reader\Reader::importString(
  668. file_get_contents($this->feedSamplePath.'/author/plain/none/rss090.xml')
  669. );
  670. $this->assertEquals(null, $feed->getAuthors());
  671. }
  672. /**
  673. * Get Single Author (Unencoded Text)
  674. */
  675. public function testGetsSingleAuthorFromRss20()
  676. {
  677. $feed = Reader\Reader::importString(
  678. file_get_contents($this->feedSamplePath.'/author/plain/rss20.xml')
  679. );
  680. $this->assertEquals(array('name'=>'Joe Bloggs','email'=>'joe@example.com'), $feed->getAuthor());
  681. }
  682. public function testGetsSingleAuthorFromRss094()
  683. {
  684. $feed = Reader\Reader::importString(
  685. file_get_contents($this->feedSamplePath.'/author/plain/rss094.xml')
  686. );
  687. $this->assertEquals(array('name'=>'Joe Bloggs','email'=>'joe@example.com'), $feed->getAuthor());
  688. }
  689. public function testGetsSingleAuthorFromRss093()
  690. {
  691. $feed = Reader\Reader::importString(
  692. file_get_contents($this->feedSamplePath.'/author/plain/rss093.xml')
  693. );
  694. $this->assertEquals(array('name'=>'Joe Bloggs','email'=>'joe@example.com'), $feed->getAuthor());
  695. }
  696. public function testGetsSingleAuthorFromRss092()
  697. {
  698. $feed = Reader\Reader::importString(
  699. file_get_contents($this->feedSamplePath.'/author/plain/rss092.xml')
  700. );
  701. $this->assertEquals(array('name'=>'Joe Bloggs','email'=>'joe@example.com'), $feed->getAuthor());
  702. }
  703. public function testGetsSingleAuthorFromRss091()
  704. {
  705. $feed = Reader\Reader::importString(
  706. file_get_contents($this->feedSamplePath.'/author/plain/rss091.xml')
  707. );
  708. $this->assertEquals(array('name'=>'Joe Bloggs','email'=>'joe@example.com'), $feed->getAuthor());
  709. }
  710. public function testGetsSingleAuthorFromRss10()
  711. {
  712. $feed = Reader\Reader::importString(
  713. file_get_contents($this->feedSamplePath.'/author/plain/rss10.xml')
  714. );
  715. $this->assertEquals(array('name'=>'Joe Bloggs','email'=>'joe@example.com'), $feed->getAuthor());
  716. }
  717. public function testGetsSingleAuthorFromRss090()
  718. {
  719. $feed = Reader\Reader::importString(
  720. file_get_contents($this->feedSamplePath.'/author/plain/rss090.xml')
  721. );
  722. $this->assertEquals(array('name'=>'Joe Bloggs','email'=>'joe@example.com'), $feed->getAuthor());
  723. }
  724. // DC 1.0
  725. public function testGetsSingleAuthorFromRss20_Dc10()
  726. {
  727. $feed = Reader\Reader::importString(
  728. file_get_contents($this->feedSamplePath.'/author/plain/dc10/rss20.xml')
  729. );
  730. $this->assertEquals(array('name'=>'Joe Bloggs'), $feed->getAuthor());
  731. }
  732. public function testGetsSingleAuthorFromRss094_Dc10()
  733. {
  734. $feed = Reader\Reader::importString(
  735. file_get_contents($this->feedSamplePath.'/author/plain/dc10/rss094.xml')
  736. );
  737. $this->assertEquals(array('name'=>'Joe Bloggs'), $feed->getAuthor());
  738. }
  739. public function testGetsSingleAuthorFromRss093_Dc10()
  740. {
  741. $feed = Reader\Reader::importString(
  742. file_get_contents($this->feedSamplePath.'/author/plain/dc10/rss093.xml')
  743. );
  744. $this->assertEquals(array('name'=>'Joe Bloggs'), $feed->getAuthor());
  745. }
  746. public function testGetsSingleAuthorFromRss092_Dc10()
  747. {
  748. $feed = Reader\Reader::importString(
  749. file_get_contents($this->feedSamplePath.'/author/plain/dc10/rss092.xml')
  750. );
  751. $this->assertEquals(array('name'=>'Joe Bloggs'), $feed->getAuthor());
  752. }
  753. public function testGetsSingleAuthorFromRss091_Dc10()
  754. {
  755. $feed = Reader\Reader::importString(
  756. file_get_contents($this->feedSamplePath.'/author/plain/dc10/rss091.xml')
  757. );
  758. $this->assertEquals(array('name'=>'Joe Bloggs'), $feed->getAuthor());
  759. }
  760. public function testGetsSingleAuthorFromRss10_Dc10()
  761. {
  762. $feed = Reader\Reader::importString(
  763. file_get_contents($this->feedSamplePath.'/author/plain/dc10/rss10.xml')
  764. );
  765. $this->assertEquals(array('name'=>'Joe Bloggs'), $feed->getAuthor());
  766. }
  767. public function testGetsSingleAuthorFromRss090_Dc10()
  768. {
  769. $feed = Reader\Reader::importString(
  770. file_get_contents($this->feedSamplePath.'/author/plain/dc10/rss090.xml')
  771. );
  772. $this->assertEquals(array('name'=>'Joe Bloggs'), $feed->getAuthor());
  773. }
  774. // DC 1.1
  775. public function testGetsSingleAuthorFromRss20_Dc11()
  776. {
  777. $feed = Reader\Reader::importString(
  778. file_get_contents($this->feedSamplePath.'/author/plain/dc11/rss20.xml')
  779. );
  780. $this->assertEquals(array('name'=>'Joe Bloggs'), $feed->getAuthor());
  781. }
  782. public function testGetsSingleAuthorFromRss094_Dc11()
  783. {
  784. $feed = Reader\Reader::importString(
  785. file_get_contents($this->feedSamplePath.'/author/plain/dc11/rss094.xml')
  786. );
  787. $this->assertEquals(array('name'=>'Joe Bloggs'), $feed->getAuthor());
  788. }
  789. public function testGetsSingleAuthorFromRss093_Dc11()
  790. {
  791. $feed = Reader\Reader::importString(
  792. file_get_contents($this->feedSamplePath.'/author/plain/dc11/rss093.xml')
  793. );
  794. $this->assertEquals(array('name'=>'Joe Bloggs'), $feed->getAuthor());
  795. }
  796. public function testGetsSingleAuthorFromRss092_Dc11()
  797. {
  798. $feed = Reader\Reader::importString(
  799. file_get_contents($this->feedSamplePath.'/author/plain/dc11/rss092.xml')
  800. );
  801. $this->assertEquals(array('name'=>'Joe Bloggs'), $feed->getAuthor());
  802. }
  803. public function testGetsSingleAuthorFromRss091_Dc11()
  804. {
  805. $feed = Reader\Reader::importString(
  806. file_get_contents($this->feedSamplePath.'/author/plain/dc11/rss091.xml')
  807. );
  808. $this->assertEquals(array('name'=>'Joe Bloggs'), $feed->getAuthor());
  809. }
  810. public function testGetsSingleAuthorFromRss10_Dc11()
  811. {
  812. $feed = Reader\Reader::importString(
  813. file_get_contents($this->feedSamplePath.'/author/plain/dc11/rss10.xml')
  814. );
  815. $this->assertEquals(array('name'=>'Joe Bloggs'), $feed->getAuthor());
  816. }
  817. public function testGetsSingleAuthorFromRss090_Dc11()
  818. {
  819. $feed = Reader\Reader::importString(
  820. file_get_contents($this->feedSamplePath.'/author/plain/dc11/rss090.xml')
  821. );
  822. $this->assertEquals(array('name'=>'Joe Bloggs'), $feed->getAuthor());
  823. }
  824. // Missing Author
  825. public function testGetsSingleAuthorFromRss20_None()
  826. {
  827. $feed = Reader\Reader::importString(
  828. file_get_contents($this->feedSamplePath.'/author/plain/none/rss20.xml')
  829. );
  830. $this->assertEquals(null, $feed->getAuthor());
  831. }
  832. public function testGetsSingleAuthorFromRss094_None()
  833. {
  834. $feed = Reader\Reader::importString(
  835. file_get_contents($this->feedSamplePath.'/author/plain/none/rss094.xml')
  836. );
  837. $this->assertEquals(null, $feed->getAuthor());
  838. }
  839. public function testGetsSingleAuthorFromRss093_None()
  840. {
  841. $feed = Reader\Reader::importString(
  842. file_get_contents($this->feedSamplePath.'/author/plain/none/rss093.xml')
  843. );
  844. $this->assertEquals(null, $feed->getAuthor());
  845. }
  846. public function testGetsSingleAuthorFromRss092_None()
  847. {
  848. $feed = Reader\Reader::importString(
  849. file_get_contents($this->feedSamplePath.'/author/plain/none/rss092.xml')
  850. );
  851. $this->assertEquals(null, $feed->getAuthor());
  852. }
  853. public function testGetsSingleAuthorFromRss091_None()
  854. {
  855. $feed = Reader\Reader::importString(
  856. file_get_contents($this->feedSamplePath.'/author/plain/none/rss091.xml')
  857. );
  858. $this->assertEquals(null, $feed->getAuthor());
  859. }
  860. public function testGetsSingleAuthorFromRss10_None()
  861. {
  862. $feed = Reader\Reader::importString(
  863. file_get_contents($this->feedSamplePath.'/author/plain/none/rss10.xml')
  864. );
  865. $this->assertEquals(null, $feed->getAuthor());
  866. }
  867. public function testGetsSingleAuthorFromRss090_None()
  868. {
  869. $feed = Reader\Reader::importString(
  870. file_get_contents($this->feedSamplePath.'/author/plain/none/rss090.xml')
  871. );
  872. $this->assertEquals(null, $feed->getAuthor());
  873. }
  874. /**
  875. * Get Copyright (Unencoded Text)
  876. */
  877. public function testGetsCopyrightFromRss20()
  878. {
  879. $feed = Reader\Reader::importString(
  880. file_get_contents($this->feedSamplePath.'/copyright/plain/rss20.xml')
  881. );
  882. $this->assertEquals('Copyright 2008', $feed->getCopyright());
  883. }
  884. public function testGetsCopyrightFromRss094()
  885. {
  886. $feed = Reader\Reader::importString(
  887. file_get_contents($this->feedSamplePath.'/copyright/plain/rss094.xml')
  888. );
  889. $this->assertEquals('Copyright 2008', $feed->getCopyright());
  890. }
  891. public function testGetsCopyrightFromRss093()
  892. {
  893. $feed = Reader\Reader::importString(
  894. file_get_contents($this->feedSamplePath.'/copyright/plain/rss093.xml')
  895. );
  896. $this->assertEquals('Copyright 2008', $feed->getCopyright());
  897. }
  898. public function testGetsCopyrightFromRss092()
  899. {
  900. $feed = Reader\Reader::importString(
  901. file_get_contents($this->feedSamplePath.'/copyright/plain/rss092.xml')
  902. );
  903. $this->assertEquals('Copyright 2008', $feed->getCopyright());
  904. }
  905. public function testGetsCopyrightFromRss091()
  906. {
  907. $feed = Reader\Reader::importString(
  908. file_get_contents($this->feedSamplePath.'/copyright/plain/rss091.xml')
  909. );
  910. $this->assertEquals('Copyright 2008', $feed->getCopyright());
  911. }
  912. public function testGetsCopyrightFromRss10()
  913. {
  914. $feed = Reader\Reader::importString(
  915. file_get_contents($this->feedSamplePath.'/copyright/plain/rss10.xml')
  916. );
  917. $this->assertEquals(null, $feed->getCopyright());
  918. }
  919. public function testGetsCopyrightFromRss090()
  920. {
  921. $feed = Reader\Reader::importString(
  922. file_get_contents($this->feedSamplePath.'/copyright/plain/rss090.xml')
  923. );
  924. $this->assertEquals(null, $feed->getCopyright());
  925. }
  926. // DC 1.0
  927. public function testGetsCopyrightFromRss20_Dc10()
  928. {
  929. $feed = Reader\Reader::importString(
  930. file_get_contents($this->feedSamplePath.'/copyright/plain/dc10/rss20.xml')
  931. );
  932. $this->assertEquals('Copyright 2008', $feed->getCopyright());
  933. }
  934. public function testGetsCopyrightFromRss094_Dc10()
  935. {
  936. $feed = Reader\Reader::importString(
  937. file_get_contents($this->feedSamplePath.'/copyright/plain/dc10/rss094.xml')
  938. );
  939. $this->assertEquals('Copyright 2008', $feed->getCopyright());
  940. }
  941. public function testGetsCopyrightFromRss093_Dc10()
  942. {
  943. $feed = Reader\Reader::importString(
  944. file_get_contents($this->feedSamplePath.'/copyright/plain/dc10/rss093.xml')
  945. );
  946. $this->assertEquals('Copyright 2008', $feed->getCopyright());
  947. }
  948. public function testGetsCopyrightFromRss092_Dc10()
  949. {
  950. $feed = Reader\Reader::importString(
  951. file_get_contents($this->feedSamplePath.'/copyright/plain/dc10/rss092.xml')
  952. );
  953. $this->assertEquals('Copyright 2008', $feed->getCopyright());
  954. }
  955. public function testGetsCopyrightFromRss091_Dc10()
  956. {
  957. $feed = Reader\Reader::importString(
  958. file_get_contents($this->feedSamplePath.'/copyright/plain/dc10/rss091.xml')
  959. );
  960. $this->assertEquals('Copyright 2008', $feed->getCopyright());
  961. }
  962. public function testGetsCopyrightFromRss10_Dc10()
  963. {
  964. $feed = Reader\Reader::importString(
  965. file_get_contents($this->feedSamplePath.'/copyright/plain/dc10/rss10.xml')
  966. );
  967. $this->assertEquals('Copyright 2008', $feed->getCopyright());
  968. }
  969. public function testGetsCopyrightFromRss090_Dc10()
  970. {
  971. $feed = Reader\Reader::importString(
  972. file_get_contents($this->feedSamplePath.'/copyright/plain/dc10/rss090.xml')
  973. );
  974. $this->assertEquals('Copyright 2008', $feed->getCopyright());
  975. }
  976. // DC 1.1
  977. public function testGetsCopyrightFromRss20_Dc11()
  978. {
  979. $feed = Reader\Reader::importString(
  980. file_get_contents($this->feedSamplePath.'/copyright/plain/dc11/rss20.xml')
  981. );
  982. $this->assertEquals('Copyright 2008', $feed->getCopyright());
  983. }
  984. public function testGetsCopyrightFromRss094_Dc11()
  985. {
  986. $feed = Reader\Reader::importString(
  987. file_get_contents($this->feedSamplePath.'/copyright/plain/dc11/rss094.xml')
  988. );
  989. $this->assertEquals('Copyright 2008', $feed->getCopyright());
  990. }
  991. public function testGetsCopyrightFromRss093_Dc11()
  992. {
  993. $feed = Reader\Reader::importString(
  994. file_get_contents($this->feedSamplePath.'/copyright/plain/dc11/rss093.xml')
  995. );
  996. $this->assertEquals('Copyright 2008', $feed->getCopyright());
  997. }
  998. public function testGetsCopyrightFromRss092_Dc11()
  999. {
  1000. $feed = Reader\Reader::importString(
  1001. file_get_contents($this->feedSamplePath.'/copyright/plain/dc11/rss092.xml')
  1002. );
  1003. $this->assertEquals('Copyright 2008', $feed->getCopyright());
  1004. }
  1005. public function testGetsCopyrightFromRss091_Dc11()
  1006. {
  1007. $feed = Reader\Reader::importString(
  1008. file_get_contents($this->feedSamplePath.'/copyright/plain/dc11/rss091.xml')
  1009. );
  1010. $this->assertEquals('Copyright 2008', $feed->getCopyright());
  1011. }
  1012. public function testGetsCopyrightFromRss10_Dc11()
  1013. {
  1014. $feed = Reader\Reader::importString(
  1015. file_get_contents($this->feedSamplePath.'/copyright/plain/dc11/rss10.xml')
  1016. );
  1017. $this->assertEquals('Copyright 2008', $feed->getCopyright());
  1018. }
  1019. public function testGetsCopyrightFromRss090_Dc11()
  1020. {
  1021. $feed = Reader\Reader::importString(
  1022. file_get_contents($this->feedSamplePath.'/copyright/plain/dc11/rss090.xml')
  1023. );
  1024. $this->assertEquals('Copyright 2008', $feed->getCopyright());
  1025. }
  1026. // Missing Copyright
  1027. public function testGetsCopyrightFromRss20_None()
  1028. {
  1029. $feed = Reader\Reader::importString(
  1030. file_get_contents($this->feedSamplePath.'/copyright/plain/none/rss20.xml')
  1031. );
  1032. $this->assertEquals(null, $feed->getCopyright());
  1033. }
  1034. public function testGetsCopyrightFromRss094_None()
  1035. {
  1036. $feed = Reader\Reader::importString(
  1037. file_get_contents($this->feedSamplePath.'/copyright/plain/none/rss094.xml')
  1038. );
  1039. $this->assertEquals(null, $feed->getCopyright());
  1040. }
  1041. public function testGetsCopyrightFromRss093_None()
  1042. {
  1043. $feed = Reader\Reader::importString(
  1044. file_get_contents($this->feedSamplePath.'/copyright/plain/none/rss093.xml')
  1045. );
  1046. $this->assertEquals(null, $feed->getCopyright());
  1047. }
  1048. public function testGetsCopyrightFromRss092_None()
  1049. {
  1050. $feed = Reader\Reader::importString(
  1051. file_get_contents($this->feedSamplePath.'/copyright/plain/none/rss092.xml')
  1052. );
  1053. $this->assertEquals(null, $feed->getCopyright());
  1054. }
  1055. public function testGetsCopyrightFromRss091_None()
  1056. {
  1057. $feed = Reader\Reader::importString(
  1058. file_get_contents($this->feedSamplePath.'/copyright/plain/none/rss091.xml')
  1059. );
  1060. $this->assertEquals(null, $feed->getCopyright());
  1061. }
  1062. public function testGetsCopyrightFromRss10_None()
  1063. {
  1064. $feed = Reader\Reader::importString(
  1065. file_get_contents($this->feedSamplePath.'/copyright/plain/none/rss10.xml')
  1066. );
  1067. $this->assertEquals(null, $feed->getCopyright());
  1068. }
  1069. public function testGetsCopyrightFromRss090_None()
  1070. {
  1071. $feed = Reader\Reader::importString(
  1072. file_get_contents($this->feedSamplePath.'/copyright/plain/none/rss090.xml')
  1073. );
  1074. $this->assertEquals(null, $feed->getCopyright());
  1075. }
  1076. /**
  1077. * Get Description (Unencoded Text)
  1078. */
  1079. public function testGetsDescriptionFromRss20()
  1080. {
  1081. $feed = Reader\Reader::importString(
  1082. file_get_contents($this->feedSamplePath.'/description/plain/rss20.xml')
  1083. );
  1084. $this->assertEquals('My Description', $feed->getDescription());
  1085. }
  1086. public function testGetsDescriptionFromRss094()
  1087. {
  1088. $feed = Reader\Reader::importString(
  1089. file_get_contents($this->feedSamplePath.'/description/plain/rss094.xml')
  1090. );
  1091. $this->assertEquals('My Description', $feed->getDescription());
  1092. }
  1093. public function testGetsDescriptionFromRss093()
  1094. {
  1095. $feed = Reader\Reader::importString(
  1096. file_get_contents($this->feedSamplePath.'/description/plain/rss093.xml')
  1097. );
  1098. $this->assertEquals('My Description', $feed->getDescription());
  1099. }
  1100. public function testGetsDescriptionFromRss092()
  1101. {
  1102. $feed = Reader\Reader::importString(
  1103. file_get_contents($this->feedSamplePath.'/description/plain/rss092.xml')
  1104. );
  1105. $this->assertEquals('My Description', $feed->getDescription());
  1106. }
  1107. public function testGetsDescriptionFromRss091()
  1108. {
  1109. $feed = Reader\Reader::importString(
  1110. file_get_contents($this->feedSamplePath.'/description/plain/rss091.xml')
  1111. );
  1112. $this->assertEquals('My Description', $feed->getDescription());
  1113. }
  1114. public function testGetsDescriptionFromRss10()
  1115. {
  1116. $feed = Reader\Reader::importString(
  1117. file_get_contents($this->feedSamplePath.'/description/plain/rss10.xml')
  1118. );
  1119. $this->assertEquals('My Description', $feed->getDescription());
  1120. }
  1121. public function testGetsDescriptionFromRss090()
  1122. {
  1123. $feed = Reader\Reader::importString(
  1124. file_get_contents($this->feedSamplePath.'/description/plain/rss090.xml')
  1125. );
  1126. $this->assertEquals('My Description', $feed->getDescription());
  1127. }
  1128. // DC 1.0
  1129. public function testGetsDescriptionFromRss20_Dc10()
  1130. {
  1131. $feed = Reader\Reader::importString(
  1132. file_get_contents($this->feedSamplePath.'/description/plain/dc10/rss20.xml')
  1133. );
  1134. $this->assertEquals('My Description', $feed->getDescription());
  1135. }
  1136. public function testGetsDescriptionFromRss094_Dc10()
  1137. {
  1138. $feed = Reader\Reader::importString(
  1139. file_get_contents($this->feedSamplePath.'/description/plain/dc10/rss094.xml')
  1140. );
  1141. $this->assertEquals('My Description', $feed->getDescription());
  1142. }
  1143. public function testGetsDescriptionFromRss093_Dc10()
  1144. {
  1145. $feed = Reader\Reader::importString(
  1146. file_get_contents($this->feedSamplePath.'/description/plain/dc10/rss093.xml')
  1147. );
  1148. $this->assertEquals('My Description', $feed->getDescription());
  1149. }
  1150. public function testGetsDescriptionFromRss092_Dc10()
  1151. {
  1152. $feed = Reader\Reader::importString(
  1153. file_get_contents($this->feedSamplePath.'/description/plain/dc10/rss092.xml')
  1154. );
  1155. $this->assertEquals('My Description', $feed->getDescription());
  1156. }
  1157. public function testGetsDescriptionFromRss091_Dc10()
  1158. {
  1159. $feed = Reader\Reader::importString(
  1160. file_get_contents($this->feedSamplePath.'/description/plain/dc10/rss091.xml')
  1161. );
  1162. $this->assertEquals('My Description', $feed->getDescription());
  1163. }
  1164. public function testGetsDescriptionFromRss10_Dc10()
  1165. {
  1166. $feed = Reader\Reader::importString(
  1167. file_get_contents($this->feedSamplePath.'/description/plain/dc10/rss10.xml')
  1168. );
  1169. $this->assertEquals('My Description', $feed->getDescription());
  1170. }
  1171. public function testGetsDescriptionFromRss090_Dc10()
  1172. {
  1173. $feed = Reader\Reader::importString(
  1174. file_get_contents($this->feedSamplePath.'/description/plain/dc10/rss090.xml')
  1175. );
  1176. $this->assertEquals('My Description', $feed->getDescription());
  1177. }
  1178. // DC 1.1
  1179. public function testGetsDescriptionFromRss20_Dc11()
  1180. {
  1181. $feed = Reader\Reader::importString(
  1182. file_get_contents($this->feedSamplePath.'/description/plain/dc11/rss20.xml')
  1183. );
  1184. $this->assertEquals('My Description', $feed->getDescription());
  1185. }
  1186. public function testGetsDescriptionFromRss094_Dc11()
  1187. {
  1188. $feed = Reader\Reader::importString(
  1189. file_get_contents($this->feedSamplePath.'/description/plain/dc11/rss094.xml')
  1190. );
  1191. $this->assertEquals('My Description', $feed->getDescription());
  1192. }
  1193. public function testGetsDescriptionFromRss093_Dc11()
  1194. {
  1195. $feed = Reader\Reader::importString(
  1196. file_get_contents($this->feedSamplePath.'/description/plain/dc11/rss093.xml')
  1197. );
  1198. $this->assertEquals('My Description', $feed->getDescription());
  1199. }
  1200. public function testGetsDescriptionFromRss092_Dc11()
  1201. {
  1202. $feed = Reader\Reader::importString(
  1203. file_get_contents($this->feedSamplePath.'/description/plain/dc11/rss092.xml')
  1204. );
  1205. $this->assertEquals('My Description', $feed->getDescription());
  1206. }
  1207. public function testGetsDescriptionFromRss091_Dc11()
  1208. {
  1209. $feed = Reader\Reader::importString(
  1210. file_get_contents($this->feedSamplePath.'/description/plain/dc11/rss091.xml')
  1211. );
  1212. $this->assertEquals('My Description', $feed->getDescription());
  1213. }
  1214. public function testGetsDescriptionFromRss10_Dc11()
  1215. {
  1216. $feed = Reader\Reader::importString(
  1217. file_get_contents($this->feedSamplePath.'/description/plain/dc11/rss10.xml')
  1218. );
  1219. $this->assertEquals('My Description', $feed->getDescription());
  1220. }
  1221. public function testGetsDescriptionFromRss090_Dc11()
  1222. {
  1223. $feed = Reader\Reader::importString(
  1224. file_get_contents($this->feedSamplePath.'/description/plain/dc11/rss090.xml')
  1225. );
  1226. $this->assertEquals('My Description', $feed->getDescription());
  1227. }
  1228. // Missing Description
  1229. public function testGetsDescriptionFromRss20_None()
  1230. {
  1231. $feed = Reader\Reader::importString(
  1232. file_get_contents($this->feedSamplePath.'/description/plain/none/rss20.xml')
  1233. );
  1234. $this->assertEquals(null, $feed->getDescription());
  1235. }
  1236. public function testGetsDescriptionFromRss094_None()
  1237. {
  1238. $feed = Reader\Reader::importString(
  1239. file_get_contents($this->feedSamplePath.'/description/plain/none/rss094.xml')
  1240. );
  1241. $this->assertEquals(null, $feed->getDescription());
  1242. }
  1243. public function testGetsDescriptionFromRss093_None()
  1244. {
  1245. $feed = Reader\Reader::importString(
  1246. file_get_contents($this->feedSamplePath.'/description/plain/none/rss093.xml')
  1247. );
  1248. $this->assertEquals(null, $feed->getDescription());
  1249. }
  1250. public function testGetsDescriptionFromRss092_None()
  1251. {
  1252. $feed = Reader\Reader::importString(
  1253. file_get_contents($this->feedSamplePath.'/description/plain/none/rss092.xml')
  1254. );
  1255. $this->assertEquals(null, $feed->getDescription());
  1256. }
  1257. public function testGetsDescriptionFromRss091_None()
  1258. {
  1259. $feed = Reader\Reader::importString(
  1260. file_get_contents($t