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

https://github.com/leerbag/zf2 · PHP · 1490 lines · 1259 code · 169 blank · 62 comment · 2 complexity · 9d4a6cf0097539bf5d68bd565aa49080 MD5 · raw file

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