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

https://github.com/zucchi/zf2 · PHP · 1495 lines · 1276 code · 173 blank · 46 comment · 0 complexity · dcd76a966f27b8f5e04d8d07c81519d9 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\Entry;
  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 Id (Unencoded Text)
  79. */
  80. public function testGetsIdFromRss20()
  81. {
  82. $feed = Reader\Reader::importString(
  83. file_get_contents($this->feedSamplePath.'/id/plain/rss20.xml')
  84. );
  85. $entry = $feed->current();
  86. $this->assertEquals('http://www.example.com/1', $entry->getId());
  87. }
  88. public function testGetsIdFromRss094()
  89. {
  90. $feed = Reader\Reader::importString(
  91. file_get_contents($this->feedSamplePath.'/id/plain/rss094.xml')
  92. );
  93. $entry = $feed->current();
  94. $this->assertEquals(null, $entry->getId());
  95. }
  96. public function testGetsIdFromRss093()
  97. {
  98. $feed = Reader\Reader::importString(
  99. file_get_contents($this->feedSamplePath.'/id/plain/rss093.xml')
  100. );
  101. $entry = $feed->current();
  102. $this->assertEquals(null, $entry->getId());
  103. }
  104. public function testGetsIdFromRss092()
  105. {
  106. $feed = Reader\Reader::importString(
  107. file_get_contents($this->feedSamplePath.'/id/plain/rss092.xml')
  108. );
  109. $entry = $feed->current();
  110. $this->assertEquals(null, $entry->getId());
  111. }
  112. public function testGetsIdFromRss091()
  113. {
  114. $feed = Reader\Reader::importString(
  115. file_get_contents($this->feedSamplePath.'/id/plain/rss091.xml')
  116. );
  117. $entry = $feed->current();
  118. $this->assertEquals(null, $entry->getId());
  119. }
  120. public function testGetsIdFromRss10()
  121. {
  122. $feed = Reader\Reader::importString(
  123. file_get_contents($this->feedSamplePath.'/id/plain/rss10.xml')
  124. );
  125. $entry = $feed->current();
  126. $this->assertEquals(null, $entry->getId());
  127. }
  128. public function testGetsIdFromRss090()
  129. {
  130. $feed = Reader\Reader::importString(
  131. file_get_contents($this->feedSamplePath.'/id/plain/rss090.xml')
  132. );
  133. $entry = $feed->current();
  134. $this->assertEquals(null, $entry->getId());
  135. }
  136. // DC 1.0
  137. public function testGetsIdFromRss20_Dc10()
  138. {
  139. $feed = Reader\Reader::importString(
  140. file_get_contents($this->feedSamplePath.'/id/plain/dc10/rss20.xml')
  141. );
  142. $entry = $feed->current();
  143. $this->assertEquals('http://www.example.com/1', $entry->getId());
  144. }
  145. public function testGetsIdFromRss094_Dc10()
  146. {
  147. $feed = Reader\Reader::importString(
  148. file_get_contents($this->feedSamplePath.'/id/plain/dc10/rss094.xml')
  149. );
  150. $entry = $feed->current();
  151. $this->assertEquals('http://www.example.com/1', $entry->getId());
  152. }
  153. public function testGetsIdFromRss093_Dc10()
  154. {
  155. $feed = Reader\Reader::importString(
  156. file_get_contents($this->feedSamplePath.'/id/plain/dc10/rss093.xml')
  157. );
  158. $entry = $feed->current();
  159. $this->assertEquals('http://www.example.com/1', $entry->getId());
  160. }
  161. public function testGetsIdFromRss092_Dc10()
  162. {
  163. $feed = Reader\Reader::importString(
  164. file_get_contents($this->feedSamplePath.'/id/plain/dc10/rss092.xml')
  165. );
  166. $entry = $feed->current();
  167. $this->assertEquals('http://www.example.com/1', $entry->getId());
  168. }
  169. public function testGetsIdFromRss091_Dc10()
  170. {
  171. $feed = Reader\Reader::importString(
  172. file_get_contents($this->feedSamplePath.'/id/plain/dc10/rss091.xml')
  173. );
  174. $entry = $feed->current();
  175. $this->assertEquals('http://www.example.com/1', $entry->getId());
  176. }
  177. public function testGetsIdFromRss10_Dc10()
  178. {
  179. $feed = Reader\Reader::importString(
  180. file_get_contents($this->feedSamplePath.'/id/plain/dc10/rss10.xml')
  181. );
  182. $entry = $feed->current();
  183. $this->assertEquals('http://www.example.com/1', $entry->getId());
  184. }
  185. public function testGetsIdFromRss090_Dc10()
  186. {
  187. $feed = Reader\Reader::importString(
  188. file_get_contents($this->feedSamplePath.'/id/plain/dc10/rss090.xml')
  189. );
  190. $entry = $feed->current();
  191. $this->assertEquals('http://www.example.com/1', $entry->getId());
  192. }
  193. // DC 1.1
  194. public function testGetsIdFromRss20_Dc11()
  195. {
  196. $feed = Reader\Reader::importString(
  197. file_get_contents($this->feedSamplePath.'/id/plain/dc11/rss20.xml')
  198. );
  199. $entry = $feed->current();
  200. $this->assertEquals('http://www.example.com/1', $entry->getId());
  201. }
  202. public function testGetsIdFromRss094_Dc11()
  203. {
  204. $feed = Reader\Reader::importString(
  205. file_get_contents($this->feedSamplePath.'/id/plain/dc11/rss094.xml')
  206. );
  207. $entry = $feed->current();
  208. $this->assertEquals('http://www.example.com/1', $entry->getId());
  209. }
  210. public function testGetsIdFromRss093_Dc11()
  211. {
  212. $feed = Reader\Reader::importString(
  213. file_get_contents($this->feedSamplePath.'/id/plain/dc11/rss093.xml')
  214. );
  215. $entry = $feed->current();
  216. $this->assertEquals('http://www.example.com/1', $entry->getId());
  217. }
  218. public function testGetsIdFromRss092_Dc11()
  219. {
  220. $feed = Reader\Reader::importString(
  221. file_get_contents($this->feedSamplePath.'/id/plain/dc11/rss092.xml')
  222. );
  223. $entry = $feed->current();
  224. $this->assertEquals('http://www.example.com/1', $entry->getId());
  225. }
  226. public function testGetsIdFromRss091_Dc11()
  227. {
  228. $feed = Reader\Reader::importString(
  229. file_get_contents($this->feedSamplePath.'/id/plain/dc11/rss091.xml')
  230. );
  231. $entry = $feed->current();
  232. $this->assertEquals('http://www.example.com/1', $entry->getId());
  233. }
  234. public function testGetsIdFromRss10_Dc11()
  235. {
  236. $feed = Reader\Reader::importString(
  237. file_get_contents($this->feedSamplePath.'/id/plain/dc11/rss10.xml')
  238. );
  239. $entry = $feed->current();
  240. $this->assertEquals('http://www.example.com/1', $entry->getId());
  241. }
  242. public function testGetsIdFromRss090_Dc11()
  243. {
  244. $feed = Reader\Reader::importString(
  245. file_get_contents($this->feedSamplePath.'/id/plain/dc11/rss090.xml')
  246. );
  247. $entry = $feed->current();
  248. $this->assertEquals('http://www.example.com/1', $entry->getId());
  249. }
  250. // Missing Id (but alternates to Title)
  251. public function testGetsIdFromRss20_Title()
  252. {
  253. $feed = Reader\Reader::importString(
  254. file_get_contents($this->feedSamplePath.'/id/plain/title/rss20.xml')
  255. );
  256. $entry = $feed->current();
  257. $this->assertEquals('Entry Title', $entry->getId());
  258. }
  259. public function testGetsIdFromRss094_Title()
  260. {
  261. $feed = Reader\Reader::importString(
  262. file_get_contents($this->feedSamplePath.'/id/plain/title/rss094.xml')
  263. );
  264. $entry = $feed->current();
  265. $this->assertEquals('Entry Title', $entry->getId());
  266. }
  267. public function testGetsIdFromRss093_Title()
  268. {
  269. $feed = Reader\Reader::importString(
  270. file_get_contents($this->feedSamplePath.'/id/plain/title/rss093.xml')
  271. );
  272. $entry = $feed->current();
  273. $this->assertEquals('Entry Title', $entry->getId());
  274. }
  275. public function testGetsIdFromRss092_Title()
  276. {
  277. $feed = Reader\Reader::importString(
  278. file_get_contents($this->feedSamplePath.'/id/plain/title/rss092.xml')
  279. );
  280. $entry = $feed->current();
  281. $this->assertEquals('Entry Title', $entry->getId());
  282. }
  283. public function testGetsIdFromRss091_Title()
  284. {
  285. $feed = Reader\Reader::importString(
  286. file_get_contents($this->feedSamplePath.'/id/plain/title/rss091.xml')
  287. );
  288. $entry = $feed->current();
  289. $this->assertEquals('Entry Title', $entry->getId());
  290. }
  291. public function testGetsIdFromRss10_Title()
  292. {
  293. $feed = Reader\Reader::importString(
  294. file_get_contents($this->feedSamplePath.'/id/plain/title/rss10.xml')
  295. );
  296. $entry = $feed->current();
  297. $this->assertEquals('Entry Title', $entry->getId());
  298. }
  299. public function testGetsIdFromRss090_Title()
  300. {
  301. $feed = Reader\Reader::importString(
  302. file_get_contents($this->feedSamplePath.'/id/plain/title/rss090.xml')
  303. );
  304. $entry = $feed->current();
  305. $this->assertEquals('Entry Title', $entry->getId());
  306. }
  307. // Missing Any Id
  308. public function testGetsIdFromRss20_None()
  309. {
  310. $feed = Reader\Reader::importString(
  311. file_get_contents($this->feedSamplePath.'/id/plain/none/rss20.xml')
  312. );
  313. $entry = $feed->current();
  314. $this->assertEquals(null, $entry->getId());
  315. }
  316. public function testGetsIdFromRss094_None()
  317. {
  318. $feed = Reader\Reader::importString(
  319. file_get_contents($this->feedSamplePath.'/id/plain/none/rss094.xml')
  320. );
  321. $entry = $feed->current();
  322. $this->assertEquals(null, $entry->getId());
  323. }
  324. public function testGetsIdFromRss093_None()
  325. {
  326. $feed = Reader\Reader::importString(
  327. file_get_contents($this->feedSamplePath.'/id/plain/none/rss093.xml')
  328. );
  329. $entry = $feed->current();
  330. $this->assertEquals(null, $entry->getId());
  331. }
  332. public function testGetsIdFromRss092_None()
  333. {
  334. $feed = Reader\Reader::importString(
  335. file_get_contents($this->feedSamplePath.'/id/plain/none/rss092.xml')
  336. );
  337. $entry = $feed->current();
  338. $this->assertEquals(null, $entry->getId());
  339. }
  340. public function testGetsIdFromRss091_None()
  341. {
  342. $feed = Reader\Reader::importString(
  343. file_get_contents($this->feedSamplePath.'/id/plain/none/rss091.xml')
  344. );
  345. $entry = $feed->current();
  346. $this->assertEquals(null, $entry->getId());
  347. }
  348. public function testGetsIdFromRss10_None()
  349. {
  350. $feed = Reader\Reader::importString(
  351. file_get_contents($this->feedSamplePath.'/id/plain/none/rss10.xml')
  352. );
  353. $entry = $feed->current();
  354. $this->assertEquals(null, $entry->getId());
  355. }
  356. public function testGetsIdFromRss090_None()
  357. {
  358. $feed = Reader\Reader::importString(
  359. file_get_contents($this->feedSamplePath.'/id/plain/none/rss090.xml')
  360. );
  361. $entry = $feed->current();
  362. $this->assertEquals(null, $entry->getId());
  363. }
  364. /**
  365. * Get Title (Unencoded Text)
  366. */
  367. public function testGetsTitleFromRss20()
  368. {
  369. $feed = Reader\Reader::importString(
  370. file_get_contents($this->feedSamplePath.'/title/plain/rss20.xml')
  371. );
  372. $entry = $feed->current();
  373. $this->assertEquals('Entry Title', $entry->getTitle());
  374. }
  375. public function testGetsTitleFromRss094()
  376. {
  377. $feed = Reader\Reader::importString(
  378. file_get_contents($this->feedSamplePath.'/title/plain/rss094.xml')
  379. );
  380. $entry = $feed->current();
  381. $this->assertEquals('Entry Title', $entry->getTitle());
  382. }
  383. public function testGetsTitleFromRss093()
  384. {
  385. $feed = Reader\Reader::importString(
  386. file_get_contents($this->feedSamplePath.'/title/plain/rss093.xml')
  387. );
  388. $entry = $feed->current();
  389. $this->assertEquals('Entry Title', $entry->getTitle());
  390. }
  391. public function testGetsTitleFromRss092()
  392. {
  393. $feed = Reader\Reader::importString(
  394. file_get_contents($this->feedSamplePath.'/title/plain/rss092.xml')
  395. );
  396. $entry = $feed->current();
  397. $this->assertEquals('Entry Title', $entry->getTitle());
  398. }
  399. public function testGetsTitleFromRss091()
  400. {
  401. $feed = Reader\Reader::importString(
  402. file_get_contents($this->feedSamplePath.'/title/plain/rss091.xml')
  403. );
  404. $entry = $feed->current();
  405. $this->assertEquals('Entry Title', $entry->getTitle());
  406. }
  407. public function testGetsTitleFromRss10()
  408. {
  409. $feed = Reader\Reader::importString(
  410. file_get_contents($this->feedSamplePath.'/title/plain/rss10.xml')
  411. );
  412. $entry = $feed->current();
  413. $this->assertEquals('Entry Title', $entry->getTitle());
  414. }
  415. public function testGetsTitleFromRss090()
  416. {
  417. $feed = Reader\Reader::importString(
  418. file_get_contents($this->feedSamplePath.'/title/plain/rss090.xml')
  419. );
  420. $entry = $feed->current();
  421. $this->assertEquals('Entry Title', $entry->getTitle());
  422. }
  423. // DC 1.0
  424. public function testGetsTitleFromRss20_Dc10()
  425. {
  426. $feed = Reader\Reader::importString(
  427. file_get_contents($this->feedSamplePath.'/title/plain/dc10/rss20.xml')
  428. );
  429. $entry = $feed->current();
  430. $this->assertEquals('Entry Title', $entry->getTitle());
  431. }
  432. public function testGetsTitleFromRss094_Dc10()
  433. {
  434. $feed = Reader\Reader::importString(
  435. file_get_contents($this->feedSamplePath.'/title/plain/dc10/rss094.xml')
  436. );
  437. $entry = $feed->current();
  438. $this->assertEquals('Entry Title', $entry->getTitle());
  439. }
  440. public function testGetsTitleFromRss093_Dc10()
  441. {
  442. $feed = Reader\Reader::importString(
  443. file_get_contents($this->feedSamplePath.'/title/plain/dc10/rss093.xml')
  444. );
  445. $entry = $feed->current();
  446. $this->assertEquals('Entry Title', $entry->getTitle());
  447. }
  448. public function testGetsTitleFromRss092_Dc10()
  449. {
  450. $feed = Reader\Reader::importString(
  451. file_get_contents($this->feedSamplePath.'/title/plain/dc10/rss092.xml')
  452. );
  453. $entry = $feed->current();
  454. $this->assertEquals('Entry Title', $entry->getTitle());
  455. }
  456. public function testGetsTitleFromRss091_Dc10()
  457. {
  458. $feed = Reader\Reader::importString(
  459. file_get_contents($this->feedSamplePath.'/title/plain/dc10/rss091.xml')
  460. );
  461. $entry = $feed->current();
  462. $this->assertEquals('Entry Title', $entry->getTitle());
  463. }
  464. public function testGetsTitleFromRss10_Dc10()
  465. {
  466. $feed = Reader\Reader::importString(
  467. file_get_contents($this->feedSamplePath.'/title/plain/dc10/rss10.xml')
  468. );
  469. $entry = $feed->current();
  470. $this->assertEquals('Entry Title', $entry->getTitle());
  471. }
  472. public function testGetsTitleFromRss090_Dc10()
  473. {
  474. $feed = Reader\Reader::importString(
  475. file_get_contents($this->feedSamplePath.'/title/plain/dc10/rss090.xml')
  476. );
  477. $entry = $feed->current();
  478. $this->assertEquals('Entry Title', $entry->getTitle());
  479. }
  480. // DC 1.1
  481. public function testGetsTitleFromRss20_Dc11()
  482. {
  483. $feed = Reader\Reader::importString(
  484. file_get_contents($this->feedSamplePath.'/title/plain/dc11/rss20.xml')
  485. );
  486. $entry = $feed->current();
  487. $this->assertEquals('Entry Title', $entry->getTitle());
  488. }
  489. public function testGetsTitleFromRss094_Dc11()
  490. {
  491. $feed = Reader\Reader::importString(
  492. file_get_contents($this->feedSamplePath.'/title/plain/dc11/rss094.xml')
  493. );
  494. $entry = $feed->current();
  495. $this->assertEquals('Entry Title', $entry->getTitle());
  496. }
  497. public function testGetsTitleFromRss093_Dc11()
  498. {
  499. $feed = Reader\Reader::importString(
  500. file_get_contents($this->feedSamplePath.'/title/plain/dc11/rss093.xml')
  501. );
  502. $entry = $feed->current();
  503. $this->assertEquals('Entry Title', $entry->getTitle());
  504. }
  505. public function testGetsTitleFromRss092_Dc11()
  506. {
  507. $feed = Reader\Reader::importString(
  508. file_get_contents($this->feedSamplePath.'/title/plain/dc11/rss092.xml')
  509. );
  510. $entry = $feed->current();
  511. $this->assertEquals('Entry Title', $entry->getTitle());
  512. }
  513. public function testGetsTitleFromRss091_Dc11()
  514. {
  515. $feed = Reader\Reader::importString(
  516. file_get_contents($this->feedSamplePath.'/title/plain/dc11/rss091.xml')
  517. );
  518. $entry = $feed->current();
  519. $this->assertEquals('Entry Title', $entry->getTitle());
  520. }
  521. public function testGetsTitleFromRss10_Dc11()
  522. {
  523. $feed = Reader\Reader::importString(
  524. file_get_contents($this->feedSamplePath.'/title/plain/dc11/rss10.xml')
  525. );
  526. $entry = $feed->current();
  527. $this->assertEquals('Entry Title', $entry->getTitle());
  528. }
  529. public function testGetsTitleFromRss090_Dc11()
  530. {
  531. $feed = Reader\Reader::importString(
  532. file_get_contents($this->feedSamplePath.'/title/plain/dc11/rss090.xml')
  533. );
  534. $entry = $feed->current();
  535. $this->assertEquals('Entry Title', $entry->getTitle());
  536. }
  537. // Missing Title
  538. public function testGetsTitleFromRss20_None()
  539. {
  540. $feed = Reader\Reader::importString(
  541. file_get_contents($this->feedSamplePath.'/title/plain/none/rss20.xml')
  542. );
  543. $entry = $feed->current();
  544. $this->assertEquals(null, $entry->getTitle());
  545. }
  546. public function testGetsTitleFromRss094_None()
  547. {
  548. $feed = Reader\Reader::importString(
  549. file_get_contents($this->feedSamplePath.'/title/plain/none/rss094.xml')
  550. );
  551. $entry = $feed->current();
  552. $this->assertEquals(null, $entry->getTitle());
  553. }
  554. public function testGetsTitleFromRss093_None()
  555. {
  556. $feed = Reader\Reader::importString(
  557. file_get_contents($this->feedSamplePath.'/title/plain/none/rss093.xml')
  558. );
  559. $entry = $feed->current();
  560. $this->assertEquals(null, $entry->getTitle());
  561. }
  562. public function testGetsTitleFromRss092_None()
  563. {
  564. $feed = Reader\Reader::importString(
  565. file_get_contents($this->feedSamplePath.'/title/plain/none/rss092.xml')
  566. );
  567. $entry = $feed->current();
  568. $this->assertEquals(null, $entry->getTitle());
  569. }
  570. public function testGetsTitleFromRss091_None()
  571. {
  572. $feed = Reader\Reader::importString(
  573. file_get_contents($this->feedSamplePath.'/title/plain/none/rss091.xml')
  574. );
  575. $entry = $feed->current();
  576. $this->assertEquals(null, $entry->getTitle());
  577. }
  578. public function testGetsTitleFromRss10_None()
  579. {
  580. $feed = Reader\Reader::importString(
  581. file_get_contents($this->feedSamplePath.'/title/plain/none/rss10.xml')
  582. );
  583. $entry = $feed->current();
  584. $this->assertEquals(null, $entry->getTitle());
  585. }
  586. public function testGetsTitleFromRss090_None()
  587. {
  588. $feed = Reader\Reader::importString(
  589. file_get_contents($this->feedSamplePath.'/title/plain/none/rss090.xml')
  590. );
  591. $entry = $feed->current();
  592. $this->assertEquals(null, $entry->getTitle());
  593. }
  594. /**
  595. * Get Authors (Unencoded Text)
  596. */
  597. public function testGetsAuthorsFromRss20()
  598. {
  599. $feed = Reader\Reader::importString(
  600. file_get_contents($this->feedSamplePath.'/author/plain/rss20.xml')
  601. );
  602. $entry = $feed->current();
  603. $this->assertEquals(array(
  604. array('email'=>'joe@example.com','name'=>'Joe Bloggs'),
  605. array('email'=>'jane@example.com','name'=>'Jane Bloggs')
  606. ), (array) $entry->getAuthors());
  607. $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $entry->getAuthors()->getValues());
  608. }
  609. public function testGetsAuthorsFromRss094()
  610. {
  611. $feed = Reader\Reader::importString(
  612. file_get_contents($this->feedSamplePath.'/author/plain/rss094.xml')
  613. );
  614. $entry = $feed->current();
  615. $this->assertEquals(null, $entry->getAuthors());
  616. }
  617. public function testGetsAuthorsFromRss093()
  618. {
  619. $feed = Reader\Reader::importString(
  620. file_get_contents($this->feedSamplePath.'/author/plain/rss093.xml')
  621. );
  622. $entry = $feed->current();
  623. $this->assertEquals(null, $entry->getAuthors());
  624. }
  625. public function testGetsAuthorsFromRss092()
  626. {
  627. $feed = Reader\Reader::importString(
  628. file_get_contents($this->feedSamplePath.'/author/plain/rss092.xml')
  629. );
  630. $entry = $feed->current();
  631. $this->assertEquals(null, $entry->getAuthors());
  632. }
  633. public function testGetsAuthorsFromRss091()
  634. {
  635. $feed = Reader\Reader::importString(
  636. file_get_contents($this->feedSamplePath.'/author/plain/rss091.xml')
  637. );
  638. $entry = $feed->current();
  639. $this->assertEquals(null, $entry->getAuthors());
  640. }
  641. public function testGetsAuthorsFromRss10()
  642. {
  643. $feed = Reader\Reader::importString(
  644. file_get_contents($this->feedSamplePath.'/author/plain/rss10.xml')
  645. );
  646. $entry = $feed->current();
  647. $this->assertEquals(null, $entry->getAuthors());
  648. }
  649. public function testGetsAuthorsFromRss090()
  650. {
  651. $feed = Reader\Reader::importString(
  652. file_get_contents($this->feedSamplePath.'/author/plain/rss090.xml')
  653. );
  654. $entry = $feed->current();
  655. $this->assertEquals(null, $entry->getAuthors());
  656. }
  657. // DC 1.0
  658. public function testGetsAuthorsFromRss20_Dc10()
  659. {
  660. $feed = Reader\Reader::importString(
  661. file_get_contents($this->feedSamplePath.'/author/plain/dc10/rss20.xml')
  662. );
  663. $entry = $feed->current();
  664. $this->assertEquals(array(
  665. array('name'=>'Joe Bloggs'), array('name'=>'Jane Bloggs')
  666. ), (array) $entry->getAuthors());
  667. $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $entry->getAuthors()->getValues());
  668. }
  669. public function testGetsAuthorsFromRss094_Dc10()
  670. {
  671. $feed = Reader\Reader::importString(
  672. file_get_contents($this->feedSamplePath.'/author/plain/dc10/rss094.xml')
  673. );
  674. $entry = $feed->current();
  675. $this->assertEquals(array(
  676. array('name'=>'Joe Bloggs'), array('name'=>'Jane Bloggs')
  677. ), (array) $entry->getAuthors());
  678. $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $entry->getAuthors()->getValues());
  679. }
  680. public function testGetsAuthorsFromRss093_Dc10()
  681. {
  682. $feed = Reader\Reader::importString(
  683. file_get_contents($this->feedSamplePath.'/author/plain/dc10/rss093.xml')
  684. );
  685. $entry = $feed->current();
  686. $this->assertEquals(array(
  687. array('name'=>'Joe Bloggs'), array('name'=>'Jane Bloggs')
  688. ), (array) $entry->getAuthors());
  689. $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $entry->getAuthors()->getValues());
  690. }
  691. public function testGetsAuthorsFromRss092_Dc10()
  692. {
  693. $feed = Reader\Reader::importString(
  694. file_get_contents($this->feedSamplePath.'/author/plain/dc10/rss092.xml')
  695. );
  696. $entry = $feed->current();
  697. $this->assertEquals(array(
  698. array('name'=>'Joe Bloggs'), array('name'=>'Jane Bloggs')
  699. ), (array) $entry->getAuthors());
  700. $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $entry->getAuthors()->getValues());
  701. }
  702. public function testGetsAuthorsFromRss091_Dc10()
  703. {
  704. $feed = Reader\Reader::importString(
  705. file_get_contents($this->feedSamplePath.'/author/plain/dc10/rss091.xml')
  706. );
  707. $entry = $feed->current();
  708. $this->assertEquals(array(
  709. array('name'=>'Joe Bloggs'), array('name'=>'Jane Bloggs')
  710. ), (array) $entry->getAuthors());
  711. $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $entry->getAuthors()->getValues());
  712. }
  713. public function testGetsAuthorsFromRss10_Dc10()
  714. {
  715. $feed = Reader\Reader::importString(
  716. file_get_contents($this->feedSamplePath.'/author/plain/dc10/rss10.xml')
  717. );
  718. $entry = $feed->current();
  719. $this->assertEquals(array(
  720. array('name'=>'Joe Bloggs'), array('name'=>'Jane Bloggs')
  721. ), (array) $entry->getAuthors());
  722. $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $entry->getAuthors()->getValues());
  723. }
  724. public function testGetsAuthorsFromRss090_Dc10()
  725. {
  726. $feed = Reader\Reader::importString(
  727. file_get_contents($this->feedSamplePath.'/author/plain/dc10/rss090.xml')
  728. );
  729. $entry = $feed->current();
  730. $this->assertEquals(array(
  731. array('name'=>'Joe Bloggs'), array('name'=>'Jane Bloggs')
  732. ), (array) $entry->getAuthors());
  733. $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $entry->getAuthors()->getValues());
  734. }
  735. // DC 1.1
  736. public function testGetsAuthorsFromRss20_Dc11()
  737. {
  738. $feed = Reader\Reader::importString(
  739. file_get_contents($this->feedSamplePath.'/author/plain/dc11/rss20.xml')
  740. );
  741. $entry = $feed->current();
  742. $this->assertEquals(array(
  743. array('name'=>'Joe Bloggs'), array('name'=>'Jane Bloggs')
  744. ), (array) $entry->getAuthors());
  745. $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $entry->getAuthors()->getValues());
  746. }
  747. public function testGetsAuthorsFromRss094_Dc11()
  748. {
  749. $feed = Reader\Reader::importString(
  750. file_get_contents($this->feedSamplePath.'/author/plain/dc11/rss094.xml')
  751. );
  752. $entry = $feed->current();
  753. $this->assertEquals(array(
  754. array('name'=>'Joe Bloggs'), array('name'=>'Jane Bloggs')
  755. ), (array) $entry->getAuthors());
  756. $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $entry->getAuthors()->getValues());
  757. }
  758. public function testGetsAuthorsFromRss093_Dc11()
  759. {
  760. $feed = Reader\Reader::importString(
  761. file_get_contents($this->feedSamplePath.'/author/plain/dc11/rss093.xml')
  762. );
  763. $entry = $feed->current();
  764. $this->assertEquals(array(
  765. array('name'=>'Joe Bloggs'), array('name'=>'Jane Bloggs')
  766. ), (array) $entry->getAuthors());
  767. $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $entry->getAuthors()->getValues());
  768. }
  769. public function testGetsAuthorsFromRss092_Dc11()
  770. {
  771. $feed = Reader\Reader::importString(
  772. file_get_contents($this->feedSamplePath.'/author/plain/dc11/rss092.xml')
  773. );
  774. $entry = $feed->current();
  775. $this->assertEquals(array(
  776. array('name'=>'Joe Bloggs'), array('name'=>'Jane Bloggs')
  777. ), (array) $entry->getAuthors());
  778. $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $entry->getAuthors()->getValues());
  779. }
  780. public function testGetsAuthorsFromRss091_Dc11()
  781. {
  782. $feed = Reader\Reader::importString(
  783. file_get_contents($this->feedSamplePath.'/author/plain/dc11/rss091.xml')
  784. );
  785. $entry = $feed->current();
  786. $this->assertEquals(array(
  787. array('name'=>'Joe Bloggs'), array('name'=>'Jane Bloggs')
  788. ), (array) $entry->getAuthors());
  789. $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $entry->getAuthors()->getValues());
  790. }
  791. public function testGetsAuthorsFromRss10_Dc11()
  792. {
  793. $feed = Reader\Reader::importString(
  794. file_get_contents($this->feedSamplePath.'/author/plain/dc11/rss10.xml')
  795. );
  796. $entry = $feed->current();
  797. $this->assertEquals(array(
  798. array('name'=>'Joe Bloggs'), array('name'=>'Jane Bloggs')
  799. ), (array) $entry->getAuthors());
  800. $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $entry->getAuthors()->getValues());
  801. }
  802. public function testGetsAuthorsFromRss090_Dc11()
  803. {
  804. $feed = Reader\Reader::importString(
  805. file_get_contents($this->feedSamplePath.'/author/plain/dc11/rss090.xml')
  806. );
  807. $entry = $feed->current();
  808. $this->assertEquals(array(
  809. array('name'=>'Joe Bloggs'), array('name'=>'Jane Bloggs')
  810. ), (array) $entry->getAuthors());
  811. $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $entry->getAuthors()->getValues());
  812. }
  813. // Missing Author
  814. public function testGetsAuthorsFromRss20_None()
  815. {
  816. $feed = Reader\Reader::importString(
  817. file_get_contents($this->feedSamplePath.'/author/plain/none/rss20.xml')
  818. );
  819. $entry = $feed->current();
  820. $this->assertEquals(null, $entry->getAuthors());
  821. }
  822. public function testGetsAuthorsFromRss094_None()
  823. {
  824. $feed = Reader\Reader::importString(
  825. file_get_contents($this->feedSamplePath.'/author/plain/none/rss094.xml')
  826. );
  827. $entry = $feed->current();
  828. $this->assertEquals(null, $entry->getAuthors());
  829. }
  830. public function testGetsAuthorsFromRss093_None()
  831. {
  832. $feed = Reader\Reader::importString(
  833. file_get_contents($this->feedSamplePath.'/author/plain/none/rss093.xml')
  834. );
  835. $entry = $feed->current();
  836. $this->assertEquals(null, $entry->getAuthors());
  837. }
  838. public function testGetsAuthorsFromRss092_None()
  839. {
  840. $feed = Reader\Reader::importString(
  841. file_get_contents($this->feedSamplePath.'/author/plain/none/rss092.xml')
  842. );
  843. $entry = $feed->current();
  844. $this->assertEquals(null, $entry->getAuthors());
  845. }
  846. public function testGetsAuthorsFromRss091_None()
  847. {
  848. $feed = Reader\Reader::importString(
  849. file_get_contents($this->feedSamplePath.'/author/plain/none/rss091.xml')
  850. );
  851. $entry = $feed->current();
  852. $this->assertEquals(null, $entry->getAuthors());
  853. }
  854. public function testGetsAuthorsFromRss10_None()
  855. {
  856. $feed = Reader\Reader::importString(
  857. file_get_contents($this->feedSamplePath.'/author/plain/none/rss10.xml')
  858. );
  859. $entry = $feed->current();
  860. $this->assertEquals(null, $entry->getAuthors());
  861. }
  862. public function testGetsAuthorsFromRss090_None()
  863. {
  864. $feed = Reader\Reader::importString(
  865. file_get_contents($this->feedSamplePath.'/author/plain/none/rss090.xml')
  866. );
  867. $entry = $feed->current();
  868. $this->assertEquals(null, $entry->getAuthors());
  869. }
  870. /**
  871. * Get Author (Unencoded Text)
  872. */
  873. public function testGetsAuthorFromRss20()
  874. {
  875. $feed = Reader\Reader::importString(
  876. file_get_contents($this->feedSamplePath.'/author/plain/rss20.xml')
  877. );
  878. $entry = $feed->current();
  879. $this->assertEquals(array('name'=>'Joe Bloggs','email'=>'joe@example.com'), $entry->getAuthor());
  880. }
  881. public function testGetsAuthorFromRss094()
  882. {
  883. $feed = Reader\Reader::importString(
  884. file_get_contents($this->feedSamplePath.'/author/plain/rss094.xml')
  885. );
  886. $entry = $feed->current();
  887. $this->assertEquals(null, $entry->getAuthor());
  888. }
  889. public function testGetsAuthorFromRss093()
  890. {
  891. $feed = Reader\Reader::importString(
  892. file_get_contents($this->feedSamplePath.'/author/plain/rss093.xml')
  893. );
  894. $entry = $feed->current();
  895. $this->assertEquals(null, $entry->getAuthor());
  896. }
  897. public function testGetsAuthorFromRss092()
  898. {
  899. $feed = Reader\Reader::importString(
  900. file_get_contents($this->feedSamplePath.'/author/plain/rss092.xml')
  901. );
  902. $entry = $feed->current();
  903. $this->assertEquals(null, $entry->getAuthor());
  904. }
  905. public function testGetsAuthorFromRss091()
  906. {
  907. $feed = Reader\Reader::importString(
  908. file_get_contents($this->feedSamplePath.'/author/plain/rss091.xml')
  909. );
  910. $entry = $feed->current();
  911. $this->assertEquals(null, $entry->getAuthor());
  912. }
  913. public function testGetsAuthorFromRss10()
  914. {
  915. $feed = Reader\Reader::importString(
  916. file_get_contents($this->feedSamplePath.'/author/plain/rss10.xml')
  917. );
  918. $entry = $feed->current();
  919. $this->assertEquals(null, $entry->getAuthor());
  920. }
  921. public function testGetsAuthorFromRss090()
  922. {
  923. $feed = Reader\Reader::importString(
  924. file_get_contents($this->feedSamplePath.'/author/plain/rss090.xml')
  925. );
  926. $entry = $feed->current();
  927. $this->assertEquals(null, $entry->getAuthor());
  928. }
  929. // DC 1.0
  930. public function testGetsAuthorFromRss20_Dc10()
  931. {
  932. $feed = Reader\Reader::importString(
  933. file_get_contents($this->feedSamplePath.'/author/plain/dc10/rss20.xml')
  934. );
  935. $entry = $feed->current();
  936. $this->assertEquals(array('name'=>'Joe Bloggs'), $entry->getAuthor());
  937. }
  938. public function testGetsAuthorFromRss094_Dc10()
  939. {
  940. $feed = Reader\Reader::importString(
  941. file_get_contents($this->feedSamplePath.'/author/plain/dc10/rss094.xml')
  942. );
  943. $entry = $feed->current();
  944. $this->assertEquals(array('name'=>'Jane Bloggs'), $entry->getAuthor(1));
  945. }
  946. public function testGetsAuthorFromRss093_Dc10()
  947. {
  948. $feed = Reader\Reader::importString(
  949. file_get_contents($this->feedSamplePath.'/author/plain/dc10/rss093.xml')
  950. );
  951. $entry = $feed->current();
  952. $this->assertEquals(array('name'=>'Joe Bloggs'), $entry->getAuthor());
  953. }
  954. public function testGetsAuthorFromRss092_Dc10()
  955. {
  956. $feed = Reader\Reader::importString(
  957. file_get_contents($this->feedSamplePath.'/author/plain/dc10/rss092.xml')
  958. );
  959. $entry = $feed->current();
  960. $this->assertEquals(array('name'=>'Jane Bloggs'), $entry->getAuthor(1));
  961. }
  962. public function testGetsAuthorFromRss091_Dc10()
  963. {
  964. $feed = Reader\Reader::importString(
  965. file_get_contents($this->feedSamplePath.'/author/plain/dc10/rss091.xml')
  966. );
  967. $entry = $feed->current();
  968. $this->assertEquals(array('name'=>'Joe Bloggs'), $entry->getAuthor());
  969. }
  970. public function testGetsAuthorFromRss10_Dc10()
  971. {
  972. $feed = Reader\Reader::importString(
  973. file_get_contents($this->feedSamplePath.'/author/plain/dc10/rss10.xml')
  974. );
  975. $entry = $feed->current();
  976. $this->assertEquals(array('name'=>'Jane Bloggs'), $entry->getAuthor(1));
  977. }
  978. public function testGetsAuthorFromRss090_Dc10()
  979. {
  980. $feed = Reader\Reader::importString(
  981. file_get_contents($this->feedSamplePath.'/author/plain/dc10/rss090.xml')
  982. );
  983. $entry = $feed->current();
  984. $this->assertEquals(array('name'=>'Joe Bloggs'), $entry->getAuthor());
  985. }
  986. // DC 1.1
  987. public function testGetsAuthorFromRss20_Dc11()
  988. {
  989. $feed = Reader\Reader::importString(
  990. file_get_contents($this->feedSamplePath.'/author/plain/dc11/rss20.xml')
  991. );
  992. $entry = $feed->current();
  993. $this->assertEquals(array('name'=>'Jane Bloggs'), $entry->getAuthor(1));
  994. }
  995. public function testGetsAuthorFromRss094_Dc11()
  996. {
  997. $feed = Reader\Reader::importString(
  998. file_get_contents($this->feedSamplePath.'/author/plain/dc11/rss094.xml')
  999. );
  1000. $entry = $feed->current();
  1001. $this->assertEquals(array('name'=>'Joe Bloggs'), $entry->getAuthor());
  1002. }
  1003. public function testGetsAuthorFromRss093_Dc11()
  1004. {
  1005. $feed = Reader\Reader::importString(
  1006. file_get_contents($this->feedSamplePath.'/author/plain/dc11/rss093.xml')
  1007. );
  1008. $entry = $feed->current();
  1009. $this->assertEquals(array('name'=>'Jane Bloggs'), $entry->getAuthor(1));
  1010. }
  1011. public function testGetsAuthorFromRss092_Dc11()
  1012. {
  1013. $feed = Reader\Reader::importString(
  1014. file_get_contents($this->feedSamplePath.'/author/plain/dc11/rss092.xml')
  1015. );
  1016. $entry = $feed->current();
  1017. $this->assertEquals(array('name'=>'Joe Bloggs'), $entry->getAuthor());
  1018. }
  1019. public function testGetsAuthorFromRss091_Dc11()
  1020. {
  1021. $feed = Reader\Reader::importString(
  1022. file_get_contents($this->feedSamplePath.'/author/plain/dc11/rss091.xml')
  1023. );
  1024. $entry = $feed->current();
  1025. $this->assertEquals(array('name'=>'Jane Bloggs'), $entry->getAuthor(1));
  1026. }
  1027. public function testGetsAuthorFromRss10_Dc11()
  1028. {
  1029. $feed = Reader\Reader::importString(
  1030. file_get_contents($this->feedSamplePath.'/author/plain/dc11/rss10.xml')
  1031. );
  1032. $entry = $feed->current();
  1033. $this->assertEquals(array('name'=>'Joe Bloggs'), $entry->getAuthor());
  1034. }
  1035. public function testGetsAuthorFromRss090_Dc11()
  1036. {
  1037. $feed = Reader\Reader::importString(
  1038. file_get_contents($this->feedSamplePath.'/author/plain/dc11/rss090.xml')
  1039. );
  1040. $entry = $feed->current();
  1041. $this->assertEquals(array('name'=>'Jane Bloggs'), $entry->getAuthor(1));
  1042. }
  1043. // Missing Id
  1044. public function testGetsAuthorFromRss20_None()
  1045. {
  1046. $feed = Reader\Reader::importString(
  1047. file_get_contents($this->feedSamplePath.'/author/plain/none/rss20.xml')
  1048. );
  1049. $entry = $feed->current();
  1050. $this->assertEquals(null, $entry->getAuthor());
  1051. }
  1052. public function testGetsAuthorFromRss094_None()
  1053. {
  1054. $feed = Reader\Reader::importString(
  1055. file_get_contents($this->feedSamplePath.'/author/plain/none/rss094.xml')
  1056. );
  1057. $entry = $feed->current();
  1058. $this->assertEquals(null, $entry->getAuthor());
  1059. }
  1060. public function testGetsAuthorFromRss093_None()
  1061. {
  1062. $feed = Reader\Reader::importString(
  1063. file_get_contents($this->feedSamplePath.'/author/plain/none/rss093.xml')
  1064. );
  1065. $entry = $feed->current();
  1066. $this->assertEquals(null, $entry->getAuthor());
  1067. }
  1068. public function testGetsAuthorFromRss092_None()
  1069. {
  1070. $feed = Reader\Reader::importString(
  1071. file_get_contents($this->feedSamplePath.'/author/plain/none/rss092.xml')
  1072. );
  1073. $entry = $feed->current();
  1074. $this->assertEquals(null, $entry->getAuthor());
  1075. }
  1076. public function testGetsAuthorFromRss091_None()
  1077. {
  1078. $feed = Reader\Reader::importString(
  1079. file_get_contents($this->feedSamplePath.'/author/plain/none/rss091.xml')
  1080. );
  1081. $entry = $feed->current();
  1082. $this->assertEquals(null, $entry->getAuthor());
  1083. }
  1084. public function testGetsAuthorFromRss10_None()
  1085. {
  1086. $feed = Reader\Reader::importString(
  1087. file_get_contents($this->feedSamplePath.'/author/plain/none/rss10.xml')
  1088. );
  1089. $entry = $feed->current();
  1090. $this->assertEquals(null, $entry->getAuthor());
  1091. }
  1092. public function testGetsAuthorFromRss090_None()
  1093. {
  1094. $feed = Reader\Reader::importString(
  1095. file_get_contents($this->feedSamplePath.'/author/plain/none/rss090.xml')
  1096. );
  1097. $entry = $feed->current();
  1098. $this->assertEquals(null, $entry->getAuthor());
  1099. }
  1100. /**
  1101. * Get Description (Unencoded Text)
  1102. */
  1103. public function testGetsDescriptionFromRss20()
  1104. {
  1105. $feed = Reader\Reader::importString(
  1106. file_get_contents($this->feedSamplePath.'/description/plain/rss20.xml')
  1107. );
  1108. $entry = $feed->current();
  1109. $this->assertEquals('Entry Description', $entry->getDescription());
  1110. }
  1111. public function testGetsDescriptionFromRss094()
  1112. {
  1113. $feed = Reader\Reader::importString(
  1114. file_get_contents($this->feedSamplePath.'/description/plain/rss094.xml')
  1115. );
  1116. $entry = $feed->current();
  1117. $this->assertEquals('Entry Description', $entry->getDescription());
  1118. }
  1119. public function testGetsDescriptionFromRss093()
  1120. {
  1121. $feed = Reader\Reader::importString(
  1122. file_get_contents($this->feedSamplePath.'/description/plain/rss093.xml')
  1123. );
  1124. $entry = $feed->current();
  1125. $this->assertEquals('Entry Description', $entry->getDescription());
  1126. }
  1127. public function testGetsDescriptionFromRss092()
  1128. {
  1129. $feed = Reader\Reader::importString(
  1130. file_get_contents($this->feedSamplePath.'/description/plain/rss092.xml')
  1131. );
  1132. $entry = $feed->current();
  1133. $this->assertEquals('Entry Description', $entry->getDescription());
  1134. }
  1135. public function testGetsDescriptionFromRss091()
  1136. {
  1137. $feed = Reader\Reader::importString(
  1138. file_get_contents($this->feedSamplePath.'/description/plain/rss091.xml')
  1139. );
  1140. $entry = $feed->current();
  1141. $this->assertEquals('Entry Description', $entry->getDescription());
  1142. }
  1143. public function testGetsDescriptionFromRss10()
  1144. {
  1145. $feed = Reader\Reader::importString(
  1146. file_get_contents($this->feedSamplePath.'/description/plain/rss10.xml')
  1147. );
  1148. $entry = $feed->current();
  1149. $this->assertEquals('Entry Description', $entry->getDescription());
  1150. }
  1151. public function testGetsDescriptionFromRss090()
  1152. {
  1153. $feed = Reader\Reader::importString(
  1154. file_get_contents($this->feedSamplePath.'/description/plain/rss090.xml')
  1155. );
  1156. $entry = $feed->current();
  1157. $this->assertEquals('Entry Description', $entry->getDescription());
  1158. }
  1159. // DC 1.0
  1160. public function testGetsDescriptionFromRss20_Dc10()
  1161. {
  1162. $feed = Reader\Reader::importString(
  1163. file_get_contents($this->feedSamplePath.'/description/plain/dc10/rss20.xml')
  1164. );
  1165. $entry = $feed->current();
  1166. $this->assertEquals('Entry Description', $entry->getDescription());
  1167. }
  1168. public function testGetsDescriptionFromRss094_Dc10()
  1169. {
  1170. $feed = Reader\Reader::importString(
  1171. file_get_contents($this->feedSamplePath.'/description/plain/dc10/rss094.xml')
  1172. );
  1173. $entry = $feed->current();
  1174. $this->assertEquals('Entry Description', $entry->getDescription());
  1175. }
  1176. public function testGetsDescriptionFromRss093_Dc10()
  1177. {
  1178. $feed = Reader\Reader::importString(
  1179. file_get_contents($this->feedSamplePath.'/description/plain/dc10/rss093.xml')
  1180. );
  1181. $entry = $feed->current();
  1182. $this->assertEquals('Entry Description', $entry->getDescription());
  1183. }
  1184. public function testGetsDescriptionFromRss092_Dc10()
  1185. {
  1186. $feed = Reader\Reader::importString(
  1187. file_get_contents($this->feedSamplePath.'/description/plain/dc10/rss092.xml')
  1188. );
  1189. $entry = $feed->current();
  1190. $this->assertEquals('Entry Description', $entry->getDescription());
  1191. }
  1192. public function testGetsDescriptionFromRss091_Dc10()
  1193. {
  1194. $feed = Reader\Reader::importString(
  1195. file_get_contents($this->feedSamplePath.'/description/plain/dc10/rss091.xml')
  1196. );
  1197. $entry = $feed->current();
  1198. $this->assertEquals('Entry Description', $entry->getDescription());
  1199. }
  1200. public function testGetsDescriptionFromRss10_Dc10()
  1201. {
  1202. $feed = Reader\Reader::importString(
  1203. file_get_contents($this->feedSamplePath.'/description/plain/dc10/rss10.xml')
  1204. );
  1205. $entry = $feed->current();
  1206. $this->assertEquals('Entry Description', $entry->getDescription());
  1207. }
  1208. public function testGetsDescriptionFromRss090_Dc10()
  1209. {
  1210. $feed = Reader\Reader::importString(
  1211. file_get_contents($this->feedSamplePath.'/description/plain/dc10/rss090.xml')
  1212. );
  1213. $entry = $feed->current();
  1214. $this->assertEquals('Entry Description', $entry->getDescription());
  1215. }
  1216. // DC 1.1
  1217. public function testGetsDescriptionFromRss20_Dc11()
  1218. {
  1219. $feed = Reader\Reader::importString(
  1220. file_get_contents($this->feedSamplePath.'/description/plain/dc11/rss20.xml')
  1221. );
  1222. $entry = $feed->current();
  1223. $this->assertEquals('Entry Description', $entry->getDescription());
  1224. }
  1225. public function testGetsDescriptionFromRss094_Dc11()
  1226. {
  1227. $feed = Reader\Reader::importString(
  1228. file_get_contents($this->feedSamplePath.'/description/plain/dc11/rss094.xml')
  1229. );
  1230. $entry = $feed->current();
  1231. $this->assertEquals('Entry Description', $entry->getDescription());
  1232. }
  1233. public function testGetsDescriptionFromRss093_Dc11()
  1234. {
  1235. $feed = Reader\Reader::importString(
  1236. file_get_contents($this->feedSamplePath.'/description/plain/dc11/rss093.xml')
  1237. );
  1238. $entry = $feed->current();
  1239. $this->assertEquals('Entry Description', $entry->getDescription());
  1240. }
  1241. public function testGetsDescriptionFromRss092_Dc11()
  1242. {
  1243. $feed = Reader\Reader::importString(
  1244. file_get_contents($this->feedSamplePath.'/description/plain/dc11/rss092.xml')
  1245. );
  1246. $entry = $feed->current();
  1247. $this->assertEquals('Entry Description', $entry->getDescription());
  1248. }
  1249. public function testGetsDescriptionFromRss091_Dc11()
  1250. {
  1251. $feed = Reader\Reader::importString(
  1252. file_get_contents($this->feedSamplePath.'/description/plain/dc11/rss091.xml')
  1253. );
  1254. $entry = $feed->current();
  1255. $this->assertEquals('Entry Description', $entry->getDescription());
  1256. }
  1257. public function testGetsDescriptionFromRss10_Dc11()
  1258. {
  1259. $feed = Reader\Reader::importString(
  1260. file_get_contents($this->feedSamplePath.'/description/plain/dc11/rss10.xml')
  1261. );
  1262. $entry = $feed->current();
  1263. $this->assertEquals('Entry Description', $entry->getDescription());
  1264. }
  1265. public function testGetsDescriptionFromRss090_Dc11()
  1266. {
  1267. $feed = Reader\Reader::importString(
  1268. file_get_contents($this->feedSamplePath.'/description/plain/dc11/rss090.xml')
  1269. );
  1270. $entry = $feed->current();
  1271. $this->assertEquals('Entry Description', $entry->getDescription());
  1272. }
  1273. // Missing Description
  1274. public function testGetsDescriptionFromRss20_None()
  1275. {
  1276. $feed = Reader\Reader::importString(
  1277. file_get_contents($this->feedSamplePath.'/description/plain/none/rss20.xml')
  1278. );
  1279. $entry = $feed->current();
  1280. $this->assertEquals(null, $entry->getDescription());
  1281. }
  1282. public function testGetsDescriptionFromRss094_None()
  1283. {
  1284. $feed = Reader\Reader::importString(
  1285. file_get_contents($this->feedSamplePath.'/description/plain/none/rss094.xml')
  1286. );
  1287. $entry = $feed->current();
  1288. $this->assertEquals(null, $entry->getDescription());
  1289. }
  1290. public function testGetsDescriptionFromRss093_None()
  1291. {
  1292. $feed = Reader\Reader::importString(
  1293. file_get_contents($this->feedSamplePath.'/description/plain/none/rss093.xml')
  1294. );
  1295. $entry = $feed->current();
  1296. $this->assertEquals(null, $entry->getDescription());
  1297. }
  1298. public function testGetsDescriptionFromRss092_None()
  1299. {
  1300. $feed = Reader\Reader::importString(
  1301. file_get_contents($this->feedSamplePath.'/description/plain/none/rss092.xml')
  1302. );
  1303. $entry = $feed->current();
  1304. $this->assertEquals(null, $entry->getDescription());
  1305. }
  1306. public function testGetsDescriptionFromRss091_None()
  1307. {
  1308. $feed = Reader\Reader::importString(
  1309. file_get_contents($this->feedSamplePath.'/description/plain/none/rss091.xml')
  1310. );
  1311. $entry = $feed->current();
  1312. $this->assertEquals(null, $entry->getDescription());
  1313. }
  1314. public function testGetsDescriptionFromRss10_None()
  1315. {
  1316. $feed = Reader\Reader::importString(
  1317. file_get_contents($this->feedSamplePath.'/description/plain/none/rss10.xml')
  1318. );
  1319. $entry = $feed->current();
  1320. $this->assertEquals(null, $entry->getDescription());
  1321. }
  1322. public function testGetsDescriptionFrom