PageRenderTime 53ms CodeModel.GetById 16ms RepoModel.GetById 0ms app.codeStats 0ms

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

https://github.com/mridgway/zf2
PHP | 2983 lines | 2480 code | 357 blank | 146 comment | 2 complexity | 53633979037618ac81ce67669671bd00 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-2010 Zend Technologies USA Inc. (http://www.zend.com)
  19. * @license http://framework.zend.com/license/new-bsd New BSD License
  20. * @version $Id: RssTest.php 22297 2010-05-25 21:33:38Z padraic $
  21. */
  22. /**
  23. * @namespace
  24. */
  25. namespace ZendTest\Feed\Reader\Feed;
  26. use Zend\Feed\Reader;
  27. use Zend\Date;
  28. /**
  29. * @category Zend
  30. * @package Zend_Feed
  31. * @subpackage UnitTests
  32. * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
  33. * @license http://framework.zend.com/license/new-bsd New BSD License
  34. * @group Zend_Feed
  35. * @group Zend_Feed_Reader
  36. */
  37. class RssTest extends \PHPUnit_Framework_TestCase
  38. {
  39. protected $_feedSamplePath = null;
  40. protected $_expectedCats = array();
  41. protected $_expectedCatsRdf = array();
  42. protected $_expectedCatsAtom = array();
  43. public function setup()
  44. {
  45. Reader\Reader::reset();
  46. if (\Zend\Registry::isRegistered('Zend_Locale')) {
  47. $registry = \Zend\Registry::getInstance();
  48. unset($registry['Zend_Locale']);
  49. }
  50. $this->_feedSamplePath = dirname(__FILE__) . '/_files/Rss';
  51. $this->_options = Date\Date::setOptions();
  52. foreach($this->_options as $k=>$v) {
  53. if (is_null($v)) {
  54. unset($this->_options[$k]);
  55. }
  56. }
  57. Date\Date::setOptions(array('format_type'=>'iso'));
  58. $this->_expectedCats = array(
  59. array(
  60. 'term' => 'topic1',
  61. 'scheme' => 'http://example.com/schema1',
  62. 'label' => 'topic1'
  63. ),
  64. array(
  65. 'term' => 'topic1',
  66. 'scheme' => 'http://example.com/schema2',
  67. 'label' => 'topic1'
  68. ),
  69. array(
  70. 'term' => 'topic2',
  71. 'scheme' => 'http://example.com/schema1',
  72. 'label' => 'topic2'
  73. )
  74. );
  75. $this->_expectedCatsRdf = array(
  76. array(
  77. 'term' => 'topic1',
  78. 'scheme' => null,
  79. 'label' => 'topic1'
  80. ),
  81. array(
  82. 'term' => 'topic2',
  83. 'scheme' => null,
  84. 'label' => 'topic2'
  85. )
  86. );
  87. $this->_expectedCatsAtom = array(
  88. array(
  89. 'term' => 'topic1',
  90. 'scheme' => 'http://example.com/schema1',
  91. 'label' => 'topic1'
  92. ),
  93. array(
  94. 'term' => 'topic1',
  95. 'scheme' => 'http://example.com/schema2',
  96. 'label' => 'topic1'
  97. ),
  98. array(
  99. 'term' => 'cat_dog',
  100. 'scheme' => 'http://example.com/schema1',
  101. 'label' => 'Cat & Dog'
  102. )
  103. );
  104. }
  105. public function teardown()
  106. {
  107. Date\Date::setOptions($this->_options);
  108. }
  109. /**
  110. * Get Title (Unencoded Text)
  111. */
  112. public function testGetsTitleFromRss20()
  113. {
  114. $feed = Reader\Reader::importString(
  115. file_get_contents($this->_feedSamplePath.'/title/plain/rss20.xml')
  116. );
  117. $this->assertEquals('My Title', $feed->getTitle());
  118. }
  119. public function testGetsTitleFromRss094()
  120. {
  121. $feed = Reader\Reader::importString(
  122. file_get_contents($this->_feedSamplePath.'/title/plain/rss094.xml')
  123. );
  124. $this->assertEquals('My Title', $feed->getTitle());
  125. }
  126. public function testGetsTitleFromRss093()
  127. {
  128. $feed = Reader\Reader::importString(
  129. file_get_contents($this->_feedSamplePath.'/title/plain/rss093.xml')
  130. );
  131. $this->assertEquals('My Title', $feed->getTitle());
  132. }
  133. public function testGetsTitleFromRss092()
  134. {
  135. $feed = Reader\Reader::importString(
  136. file_get_contents($this->_feedSamplePath.'/title/plain/rss092.xml')
  137. );
  138. $this->assertEquals('My Title', $feed->getTitle());
  139. }
  140. public function testGetsTitleFromRss091()
  141. {
  142. $feed = Reader\Reader::importString(
  143. file_get_contents($this->_feedSamplePath.'/title/plain/rss091.xml')
  144. );
  145. $this->assertEquals('My Title', $feed->getTitle());
  146. }
  147. public function testGetsTitleFromRss10()
  148. {
  149. $feed = Reader\Reader::importString(
  150. file_get_contents($this->_feedSamplePath.'/title/plain/rss10.xml')
  151. );
  152. $this->assertEquals('My Title', $feed->getTitle());
  153. }
  154. public function testGetsTitleFromRss090()
  155. {
  156. $feed = Reader\Reader::importString(
  157. file_get_contents($this->_feedSamplePath.'/title/plain/rss090.xml')
  158. );
  159. $this->assertEquals('My Title', $feed->getTitle());
  160. }
  161. // DC 1.0
  162. public function testGetsTitleFromRss20_Dc10()
  163. {
  164. $feed = Reader\Reader::importString(
  165. file_get_contents($this->_feedSamplePath.'/title/plain/dc10/rss20.xml')
  166. );
  167. $this->assertEquals('My Title', $feed->getTitle());
  168. }
  169. public function testGetsTitleFromRss094_Dc10()
  170. {
  171. $feed = Reader\Reader::importString(
  172. file_get_contents($this->_feedSamplePath.'/title/plain/dc10/rss094.xml')
  173. );
  174. $this->assertEquals('My Title', $feed->getTitle());
  175. }
  176. public function testGetsTitleFromRss093_Dc10()
  177. {
  178. $feed = Reader\Reader::importString(
  179. file_get_contents($this->_feedSamplePath.'/title/plain/dc10/rss093.xml')
  180. );
  181. $this->assertEquals('My Title', $feed->getTitle());
  182. }
  183. public function testGetsTitleFromRss092_Dc10()
  184. {
  185. $feed = Reader\Reader::importString(
  186. file_get_contents($this->_feedSamplePath.'/title/plain/dc10/rss092.xml')
  187. );
  188. $this->assertEquals('My Title', $feed->getTitle());
  189. }
  190. public function testGetsTitleFromRss091_Dc10()
  191. {
  192. $feed = Reader\Reader::importString(
  193. file_get_contents($this->_feedSamplePath.'/title/plain/dc10/rss091.xml')
  194. );
  195. $this->assertEquals('My Title', $feed->getTitle());
  196. }
  197. public function testGetsTitleFromRss10_Dc10()
  198. {
  199. $feed = Reader\Reader::importString(
  200. file_get_contents($this->_feedSamplePath.'/title/plain/dc10/rss10.xml')
  201. );
  202. $this->assertEquals('My Title', $feed->getTitle());
  203. }
  204. public function testGetsTitleFromRss090_Dc10()
  205. {
  206. $feed = Reader\Reader::importString(
  207. file_get_contents($this->_feedSamplePath.'/title/plain/dc10/rss090.xml')
  208. );
  209. $this->assertEquals('My Title', $feed->getTitle());
  210. }
  211. // DC 1.1
  212. public function testGetsTitleFromRss20_Dc11()
  213. {
  214. $feed = Reader\Reader::importString(
  215. file_get_contents($this->_feedSamplePath.'/title/plain/dc11/rss20.xml')
  216. );
  217. $this->assertEquals('My Title', $feed->getTitle());
  218. }
  219. public function testGetsTitleFromRss094_Dc11()
  220. {
  221. $feed = Reader\Reader::importString(
  222. file_get_contents($this->_feedSamplePath.'/title/plain/dc11/rss094.xml')
  223. );
  224. $this->assertEquals('My Title', $feed->getTitle());
  225. }
  226. public function testGetsTitleFromRss093_Dc11()
  227. {
  228. $feed = Reader\Reader::importString(
  229. file_get_contents($this->_feedSamplePath.'/title/plain/dc11/rss093.xml')
  230. );
  231. $this->assertEquals('My Title', $feed->getTitle());
  232. }
  233. public function testGetsTitleFromRss092_Dc11()
  234. {
  235. $feed = Reader\Reader::importString(
  236. file_get_contents($this->_feedSamplePath.'/title/plain/dc11/rss092.xml')
  237. );
  238. $this->assertEquals('My Title', $feed->getTitle());
  239. }
  240. public function testGetsTitleFromRss091_Dc11()
  241. {
  242. $feed = Reader\Reader::importString(
  243. file_get_contents($this->_feedSamplePath.'/title/plain/dc11/rss091.xml')
  244. );
  245. $this->assertEquals('My Title', $feed->getTitle());
  246. }
  247. public function testGetsTitleFromRss10_Dc11()
  248. {
  249. $feed = Reader\Reader::importString(
  250. file_get_contents($this->_feedSamplePath.'/title/plain/dc11/rss10.xml')
  251. );
  252. $this->assertEquals('My Title', $feed->getTitle());
  253. }
  254. public function testGetsTitleFromRss090_Dc11()
  255. {
  256. $feed = Reader\Reader::importString(
  257. file_get_contents($this->_feedSamplePath.'/title/plain/dc11/rss090.xml')
  258. );
  259. $this->assertEquals('My Title', $feed->getTitle());
  260. }
  261. // Atom 1.0
  262. public function testGetsTitleFromRss20_atom10()
  263. {
  264. $feed = Reader\Reader::importString(
  265. file_get_contents($this->_feedSamplePath.'/title/plain/atom10/rss20.xml')
  266. );
  267. $this->assertEquals('My Title', $feed->getTitle());
  268. }
  269. public function testGetsTitleFromRss094_atom10()
  270. {
  271. $feed = Reader\Reader::importString(
  272. file_get_contents($this->_feedSamplePath.'/title/plain/atom10/rss094.xml')
  273. );
  274. $this->assertEquals('My Title', $feed->getTitle());
  275. }
  276. public function testGetsTitleFromRss093_atom10()
  277. {
  278. $feed = Reader\Reader::importString(
  279. file_get_contents($this->_feedSamplePath.'/title/plain/atom10/rss093.xml')
  280. );
  281. $this->assertEquals('My Title', $feed->getTitle());
  282. }
  283. public function testGetsTitleFromRss092_atom10()
  284. {
  285. $feed = Reader\Reader::importString(
  286. file_get_contents($this->_feedSamplePath.'/title/plain/atom10/rss092.xml')
  287. );
  288. $this->assertEquals('My Title', $feed->getTitle());
  289. }
  290. public function testGetsTitleFromRss091_atom10()
  291. {
  292. $feed = Reader\Reader::importString(
  293. file_get_contents($this->_feedSamplePath.'/title/plain/atom10/rss091.xml')
  294. );
  295. $this->assertEquals('My Title', $feed->getTitle());
  296. }
  297. public function testGetsTitleFromRss10_atom10()
  298. {
  299. $feed = Reader\Reader::importString(
  300. file_get_contents($this->_feedSamplePath.'/title/plain/atom10/rss10.xml')
  301. );
  302. $this->assertEquals('My Title', $feed->getTitle());
  303. }
  304. public function testGetsTitleFromRss090_atom10()
  305. {
  306. $feed = Reader\Reader::importString(
  307. file_get_contents($this->_feedSamplePath.'/title/plain/atom10/rss090.xml')
  308. );
  309. $this->assertEquals('My Title', $feed->getTitle());
  310. }
  311. // Missing Title
  312. public function testGetsTitleFromRss20_None()
  313. {
  314. $feed = Reader\Reader::importString(
  315. file_get_contents($this->_feedSamplePath.'/title/plain/none/rss20.xml')
  316. );
  317. $this->assertEquals(null, $feed->getTitle());
  318. }
  319. public function testGetsTitleFromRss094_None()
  320. {
  321. $feed = Reader\Reader::importString(
  322. file_get_contents($this->_feedSamplePath.'/title/plain/none/rss094.xml')
  323. );
  324. $this->assertEquals(null, $feed->getTitle());
  325. }
  326. public function testGetsTitleFromRss093_None()
  327. {
  328. $feed = Reader\Reader::importString(
  329. file_get_contents($this->_feedSamplePath.'/title/plain/none/rss093.xml')
  330. );
  331. $this->assertEquals(null, $feed->getTitle());
  332. }
  333. public function testGetsTitleFromRss092_None()
  334. {
  335. $feed = Reader\Reader::importString(
  336. file_get_contents($this->_feedSamplePath.'/title/plain/none/rss092.xml')
  337. );
  338. $this->assertEquals(null, $feed->getTitle());
  339. }
  340. public function testGetsTitleFromRss091_None()
  341. {
  342. $feed = Reader\Reader::importString(
  343. file_get_contents($this->_feedSamplePath.'/title/plain/none/rss091.xml')
  344. );
  345. $this->assertEquals(null, $feed->getTitle());
  346. }
  347. public function testGetsTitleFromRss10_None()
  348. {
  349. $feed = Reader\Reader::importString(
  350. file_get_contents($this->_feedSamplePath.'/title/plain/none/rss10.xml')
  351. );
  352. $this->assertEquals(null, $feed->getTitle());
  353. }
  354. public function testGetsTitleFromRss090_None()
  355. {
  356. $feed = Reader\Reader::importString(
  357. file_get_contents($this->_feedSamplePath.'/title/plain/none/rss090.xml')
  358. );
  359. $this->assertEquals(null, $feed->getTitle());
  360. }
  361. /**
  362. * Get Authors (Unencoded Text)
  363. */
  364. public function testGetsAuthorArrayFromRss20()
  365. {
  366. $feed = Reader\Reader::importString(
  367. file_get_contents($this->_feedSamplePath.'/author/plain/rss20.xml')
  368. );
  369. $this->assertEquals(array(
  370. array('email'=>'joe@example.com','name'=>'Joe Bloggs'),
  371. array('email'=>'jane@example.com','name'=>'Jane Bloggs')
  372. ), (array) $feed->getAuthors());
  373. $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $feed->getAuthors()->getValues());
  374. }
  375. public function testGetsAuthorArrayFromRss094()
  376. {
  377. $feed = Reader\Reader::importString(
  378. file_get_contents($this->_feedSamplePath.'/author/plain/rss094.xml')
  379. );
  380. $this->assertEquals(array(
  381. array('email'=>'joe@example.com','name'=>'Joe Bloggs'),
  382. array('email'=>'jane@example.com','name'=>'Jane Bloggs')
  383. ), (array) $feed->getAuthors());
  384. $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $feed->getAuthors()->getValues());
  385. }
  386. public function testGetsAuthorArrayFromRss093()
  387. {
  388. $feed = Reader\Reader::importString(
  389. file_get_contents($this->_feedSamplePath.'/author/plain/rss093.xml')
  390. );
  391. $this->assertEquals(array(
  392. array('email'=>'joe@example.com','name'=>'Joe Bloggs'),
  393. array('email'=>'jane@example.com','name'=>'Jane Bloggs')
  394. ), (array) $feed->getAuthors());
  395. $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $feed->getAuthors()->getValues());
  396. }
  397. public function testGetsAuthorArrayFromRss092()
  398. {
  399. $feed = Reader\Reader::importString(
  400. file_get_contents($this->_feedSamplePath.'/author/plain/rss092.xml')
  401. );
  402. $this->assertEquals(array(
  403. array('email'=>'joe@example.com','name'=>'Joe Bloggs'),
  404. array('email'=>'jane@example.com','name'=>'Jane Bloggs')
  405. ), (array) $feed->getAuthors());
  406. $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $feed->getAuthors()->getValues());
  407. }
  408. public function testGetsAuthorArrayFromRss091()
  409. {
  410. $feed = Reader\Reader::importString(
  411. file_get_contents($this->_feedSamplePath.'/author/plain/rss091.xml')
  412. );
  413. $this->assertEquals(array(
  414. array('email'=>'joe@example.com','name'=>'Joe Bloggs'),
  415. array('email'=>'jane@example.com','name'=>'Jane Bloggs')
  416. ), (array) $feed->getAuthors());
  417. $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $feed->getAuthors()->getValues());
  418. }
  419. public function testGetsAuthorArrayFromRss10()
  420. {
  421. $feed = Reader\Reader::importString(
  422. file_get_contents($this->_feedSamplePath.'/author/plain/rss10.xml')
  423. );
  424. $this->assertEquals(array(
  425. array('email'=>'joe@example.com','name'=>'Joe Bloggs'),
  426. array('email'=>'jane@example.com','name'=>'Jane Bloggs')
  427. ), (array) $feed->getAuthors());
  428. $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $feed->getAuthors()->getValues());
  429. }
  430. public function testGetsAuthorArrayFromRss090()
  431. {
  432. $feed = Reader\Reader::importString(
  433. file_get_contents($this->_feedSamplePath.'/author/plain/rss090.xml')
  434. );
  435. $this->assertEquals(array(
  436. array('email'=>'joe@example.com','name'=>'Joe Bloggs'),
  437. array('email'=>'jane@example.com','name'=>'Jane Bloggs')
  438. ), (array) $feed->getAuthors());
  439. $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $feed->getAuthors()->getValues());
  440. }
  441. // DC 1.0
  442. public function testGetsAuthorArrayFromRss20_Dc10()
  443. {
  444. $feed = Reader\Reader::importString(
  445. file_get_contents($this->_feedSamplePath.'/author/plain/dc10/rss20.xml')
  446. );
  447. $this->assertEquals(array(
  448. array('name'=>'Joe Bloggs'), array('name'=>'Jane Bloggs')
  449. ), (array) $feed->getAuthors());
  450. $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $feed->getAuthors()->getValues());
  451. }
  452. public function testGetsAuthorArrayFromRss094_Dc10()
  453. {
  454. $feed = Reader\Reader::importString(
  455. file_get_contents($this->_feedSamplePath.'/author/plain/dc10/rss094.xml')
  456. );
  457. $this->assertEquals(array(
  458. array('name'=>'Joe Bloggs'), array('name'=>'Jane Bloggs')
  459. ), (array) $feed->getAuthors());
  460. $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $feed->getAuthors()->getValues());
  461. }
  462. public function testGetsAuthorArrayFromRss093_Dc10()
  463. {
  464. $feed = Reader\Reader::importString(
  465. file_get_contents($this->_feedSamplePath.'/author/plain/dc10/rss093.xml')
  466. );
  467. $this->assertEquals(array(
  468. array('name'=>'Joe Bloggs'), array('name'=>'Jane Bloggs')
  469. ), (array) $feed->getAuthors());
  470. $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $feed->getAuthors()->getValues());
  471. }
  472. public function testGetsAuthorArrayFromRss092_Dc10()
  473. {
  474. $feed = Reader\Reader::importString(
  475. file_get_contents($this->_feedSamplePath.'/author/plain/dc10/rss092.xml')
  476. );
  477. $this->assertEquals(array(
  478. array('name'=>'Joe Bloggs'), array('name'=>'Jane Bloggs')
  479. ), (array) $feed->getAuthors());
  480. $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $feed->getAuthors()->getValues());
  481. }
  482. public function testGetsAuthorArrayFromRss091_Dc10()
  483. {
  484. $feed = Reader\Reader::importString(
  485. file_get_contents($this->_feedSamplePath.'/author/plain/dc10/rss091.xml')
  486. );
  487. $this->assertEquals(array(
  488. array('name'=>'Joe Bloggs'), array('name'=>'Jane Bloggs')
  489. ), (array) $feed->getAuthors());
  490. $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $feed->getAuthors()->getValues());
  491. }
  492. public function testGetsAuthorArrayFromRss10_Dc10()
  493. {
  494. $feed = Reader\Reader::importString(
  495. file_get_contents($this->_feedSamplePath.'/author/plain/dc10/rss10.xml')
  496. );
  497. $this->assertEquals(array(
  498. array('name'=>'Joe Bloggs'), array('name'=>'Jane Bloggs')
  499. ), (array) $feed->getAuthors());
  500. $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $feed->getAuthors()->getValues());
  501. }
  502. public function testGetsAuthorArrayFromRss090_Dc10()
  503. {
  504. $feed = Reader\Reader::importString(
  505. file_get_contents($this->_feedSamplePath.'/author/plain/dc10/rss090.xml')
  506. );
  507. $this->assertEquals(array(
  508. array('name'=>'Joe Bloggs'), array('name'=>'Jane Bloggs')
  509. ), (array) $feed->getAuthors());
  510. $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $feed->getAuthors()->getValues());
  511. }
  512. // DC 1.1
  513. public function testGetsAuthorArrayFromRss20_Dc11()
  514. {
  515. $feed = Reader\Reader::importString(
  516. file_get_contents($this->_feedSamplePath.'/author/plain/dc11/rss20.xml')
  517. );
  518. $this->assertEquals(array(
  519. array('name'=>'Joe Bloggs'), array('name'=>'Jane Bloggs')
  520. ), (array) $feed->getAuthors());
  521. $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $feed->getAuthors()->getValues());
  522. }
  523. public function testGetsAuthorArrayFromRss094_Dc11()
  524. {
  525. $feed = Reader\Reader::importString(
  526. file_get_contents($this->_feedSamplePath.'/author/plain/dc11/rss094.xml')
  527. );
  528. $this->assertEquals(array(
  529. array('name'=>'Joe Bloggs'), array('name'=>'Jane Bloggs')
  530. ), (array) $feed->getAuthors());
  531. $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $feed->getAuthors()->getValues());
  532. }
  533. public function testGetsAuthorArrayFromRss093_Dc11()
  534. {
  535. $feed = Reader\Reader::importString(
  536. file_get_contents($this->_feedSamplePath.'/author/plain/dc11/rss093.xml')
  537. );
  538. $this->assertEquals(array(
  539. array('name'=>'Joe Bloggs'), array('name'=>'Jane Bloggs')
  540. ), (array) $feed->getAuthors());
  541. $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $feed->getAuthors()->getValues());
  542. }
  543. public function testGetsAuthorArrayFromRss092_Dc11()
  544. {
  545. $feed = Reader\Reader::importString(
  546. file_get_contents($this->_feedSamplePath.'/author/plain/dc11/rss092.xml')
  547. );
  548. $this->assertEquals(array(
  549. array('name'=>'Joe Bloggs'), array('name'=>'Jane Bloggs')
  550. ), (array) $feed->getAuthors());
  551. $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $feed->getAuthors()->getValues());
  552. }
  553. public function testGetsAuthorArrayFromRss091_Dc11()
  554. {
  555. $feed = Reader\Reader::importString(
  556. file_get_contents($this->_feedSamplePath.'/author/plain/dc11/rss091.xml')
  557. );
  558. $this->assertEquals(array(
  559. array('name'=>'Joe Bloggs'), array('name'=>'Jane Bloggs')
  560. ), (array) $feed->getAuthors());
  561. $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $feed->getAuthors()->getValues());
  562. }
  563. public function testGetsAuthorArrayFromRss10_Dc11()
  564. {
  565. $feed = Reader\Reader::importString(
  566. file_get_contents($this->_feedSamplePath.'/author/plain/dc11/rss10.xml')
  567. );
  568. $this->assertEquals(array(
  569. array('name'=>'Joe Bloggs'), array('name'=>'Jane Bloggs')
  570. ), (array) $feed->getAuthors());
  571. $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $feed->getAuthors()->getValues());
  572. }
  573. public function testGetsAuthorArrayFromRss090_Dc11()
  574. {
  575. $feed = Reader\Reader::importString(
  576. file_get_contents($this->_feedSamplePath.'/author/plain/dc11/rss090.xml')
  577. );
  578. $this->assertEquals(array(
  579. array('name'=>'Joe Bloggs'), array('name'=>'Jane Bloggs')
  580. ), (array) $feed->getAuthors());
  581. $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $feed->getAuthors()->getValues());
  582. }
  583. // Atom 1.0
  584. public function testGetsAuthorArrayFromRss20_Atom10()
  585. {
  586. $feed = Reader\Reader::importString(
  587. file_get_contents($this->_feedSamplePath.'/author/plain/atom10/rss20.xml')
  588. );
  589. $this->assertEquals(array(
  590. array('name'=>'Joe Bloggs'), array('name'=>'Jane Bloggs')
  591. ), (array) $feed->getAuthors());
  592. $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $feed->getAuthors()->getValues());
  593. }
  594. public function testGetsAuthorArrayFromRss094_Atom10()
  595. {
  596. $feed = Reader\Reader::importString(
  597. file_get_contents($this->_feedSamplePath.'/author/plain/atom10/rss094.xml')
  598. );
  599. $this->assertEquals(array(
  600. array('name'=>'Joe Bloggs'), array('name'=>'Jane Bloggs')
  601. ), (array) $feed->getAuthors());
  602. $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $feed->getAuthors()->getValues());
  603. }
  604. public function testGetsAuthorArrayFromRss093_Atom10()
  605. {
  606. $feed = Reader\Reader::importString(
  607. file_get_contents($this->_feedSamplePath.'/author/plain/atom10/rss093.xml')
  608. );
  609. $this->assertEquals(array(
  610. array('name'=>'Joe Bloggs'), array('name'=>'Jane Bloggs')
  611. ), (array) $feed->getAuthors());
  612. $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $feed->getAuthors()->getValues());
  613. }
  614. public function testGetsAuthorArrayFromRss092_Atom10()
  615. {
  616. $feed = Reader\Reader::importString(
  617. file_get_contents($this->_feedSamplePath.'/author/plain/atom10/rss092.xml')
  618. );
  619. $this->assertEquals(array(
  620. array('name'=>'Joe Bloggs'), array('name'=>'Jane Bloggs')
  621. ), (array) $feed->getAuthors());
  622. $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $feed->getAuthors()->getValues());
  623. }
  624. public function testGetsAuthorArrayFromRss091_Atom10()
  625. {
  626. $feed = Reader\Reader::importString(
  627. file_get_contents($this->_feedSamplePath.'/author/plain/atom10/rss091.xml')
  628. );
  629. $this->assertEquals(array(
  630. array('name'=>'Joe Bloggs'), array('name'=>'Jane Bloggs')
  631. ), (array) $feed->getAuthors());
  632. $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $feed->getAuthors()->getValues());
  633. }
  634. public function testGetsAuthorArrayFromRss10_Atom10()
  635. {
  636. $feed = Reader\Reader::importString(
  637. file_get_contents($this->_feedSamplePath.'/author/plain/atom10/rss10.xml')
  638. );
  639. $this->assertEquals(array(
  640. array('name'=>'Joe Bloggs'), array('name'=>'Jane Bloggs')
  641. ), (array) $feed->getAuthors());
  642. $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $feed->getAuthors()->getValues());
  643. }
  644. public function testGetsAuthorArrayFromRss090_Atom10()
  645. {
  646. $feed = Reader\Reader::importString(
  647. file_get_contents($this->_feedSamplePath.'/author/plain/atom10/rss090.xml')
  648. );
  649. $this->assertEquals(array(
  650. array('name'=>'Joe Bloggs'), array('name'=>'Jane Bloggs')
  651. ), (array) $feed->getAuthors());
  652. $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $feed->getAuthors()->getValues());
  653. }
  654. // Missing Authors
  655. public function testGetsAuthorArrayFromRss20_None()
  656. {
  657. $feed = Reader\Reader::importString(
  658. file_get_contents($this->_feedSamplePath.'/author/plain/none/rss20.xml')
  659. );
  660. $this->assertEquals(null, $feed->getAuthors());
  661. }
  662. public function testGetsAuthorArrayFromRss094_None()
  663. {
  664. $feed = Reader\Reader::importString(
  665. file_get_contents($this->_feedSamplePath.'/author/plain/none/rss094.xml')
  666. );
  667. $this->assertEquals(null, $feed->getAuthors());
  668. }
  669. public function testGetsAuthorArrayFromRss093_None()
  670. {
  671. $feed = Reader\Reader::importString(
  672. file_get_contents($this->_feedSamplePath.'/author/plain/none/rss093.xml')
  673. );
  674. $this->assertEquals(null, $feed->getAuthors());
  675. }
  676. public function testGetsAuthorArrayFromRss092_None()
  677. {
  678. $feed = Reader\Reader::importString(
  679. file_get_contents($this->_feedSamplePath.'/author/plain/none/rss092.xml')
  680. );
  681. $this->assertEquals(null, $feed->getAuthors());
  682. }
  683. public function testGetsAuthorArrayFromRss091_None()
  684. {
  685. $feed = Reader\Reader::importString(
  686. file_get_contents($this->_feedSamplePath.'/author/plain/none/rss091.xml')
  687. );
  688. $this->assertEquals(null, $feed->getAuthors());
  689. }
  690. public function testGetsAuthorArrayFromRss10_None()
  691. {
  692. $feed = Reader\Reader::importString(
  693. file_get_contents($this->_feedSamplePath.'/author/plain/none/rss10.xml')
  694. );
  695. $this->assertEquals(null, $feed->getAuthors());
  696. }
  697. public function testGetsAuthorArrayFromRss090_None()
  698. {
  699. $feed = Reader\Reader::importString(
  700. file_get_contents($this->_feedSamplePath.'/author/plain/none/rss090.xml')
  701. );
  702. $this->assertEquals(null, $feed->getAuthors());
  703. }
  704. /**
  705. * Get Single Author (Unencoded Text)
  706. */
  707. public function testGetsSingleAuthorFromRss20()
  708. {
  709. $feed = Reader\Reader::importString(
  710. file_get_contents($this->_feedSamplePath.'/author/plain/rss20.xml')
  711. );
  712. $this->assertEquals(array('name'=>'Joe Bloggs','email'=>'joe@example.com'), $feed->getAuthor());
  713. }
  714. public function testGetsSingleAuthorFromRss094()
  715. {
  716. $feed = Reader\Reader::importString(
  717. file_get_contents($this->_feedSamplePath.'/author/plain/rss094.xml')
  718. );
  719. $this->assertEquals(array('name'=>'Joe Bloggs','email'=>'joe@example.com'), $feed->getAuthor());
  720. }
  721. public function testGetsSingleAuthorFromRss093()
  722. {
  723. $feed = Reader\Reader::importString(
  724. file_get_contents($this->_feedSamplePath.'/author/plain/rss093.xml')
  725. );
  726. $this->assertEquals(array('name'=>'Joe Bloggs','email'=>'joe@example.com'), $feed->getAuthor());
  727. }
  728. public function testGetsSingleAuthorFromRss092()
  729. {
  730. $feed = Reader\Reader::importString(
  731. file_get_contents($this->_feedSamplePath.'/author/plain/rss092.xml')
  732. );
  733. $this->assertEquals(array('name'=>'Joe Bloggs','email'=>'joe@example.com'), $feed->getAuthor());
  734. }
  735. public function testGetsSingleAuthorFromRss091()
  736. {
  737. $feed = Reader\Reader::importString(
  738. file_get_contents($this->_feedSamplePath.'/author/plain/rss091.xml')
  739. );
  740. $this->assertEquals(array('name'=>'Joe Bloggs','email'=>'joe@example.com'), $feed->getAuthor());
  741. }
  742. public function testGetsSingleAuthorFromRss10()
  743. {
  744. $feed = Reader\Reader::importString(
  745. file_get_contents($this->_feedSamplePath.'/author/plain/rss10.xml')
  746. );
  747. $this->assertEquals(array('name'=>'Joe Bloggs','email'=>'joe@example.com'), $feed->getAuthor());
  748. }
  749. public function testGetsSingleAuthorFromRss090()
  750. {
  751. $feed = Reader\Reader::importString(
  752. file_get_contents($this->_feedSamplePath.'/author/plain/rss090.xml')
  753. );
  754. $this->assertEquals(array('name'=>'Joe Bloggs','email'=>'joe@example.com'), $feed->getAuthor());
  755. }
  756. // DC 1.0
  757. public function testGetsSingleAuthorFromRss20_Dc10()
  758. {
  759. $feed = Reader\Reader::importString(
  760. file_get_contents($this->_feedSamplePath.'/author/plain/dc10/rss20.xml')
  761. );
  762. $this->assertEquals(array('name'=>'Joe Bloggs'), $feed->getAuthor());
  763. }
  764. public function testGetsSingleAuthorFromRss094_Dc10()
  765. {
  766. $feed = Reader\Reader::importString(
  767. file_get_contents($this->_feedSamplePath.'/author/plain/dc10/rss094.xml')
  768. );
  769. $this->assertEquals(array('name'=>'Joe Bloggs'), $feed->getAuthor());
  770. }
  771. public function testGetsSingleAuthorFromRss093_Dc10()
  772. {
  773. $feed = Reader\Reader::importString(
  774. file_get_contents($this->_feedSamplePath.'/author/plain/dc10/rss093.xml')
  775. );
  776. $this->assertEquals(array('name'=>'Joe Bloggs'), $feed->getAuthor());
  777. }
  778. public function testGetsSingleAuthorFromRss092_Dc10()
  779. {
  780. $feed = Reader\Reader::importString(
  781. file_get_contents($this->_feedSamplePath.'/author/plain/dc10/rss092.xml')
  782. );
  783. $this->assertEquals(array('name'=>'Joe Bloggs'), $feed->getAuthor());
  784. }
  785. public function testGetsSingleAuthorFromRss091_Dc10()
  786. {
  787. $feed = Reader\Reader::importString(
  788. file_get_contents($this->_feedSamplePath.'/author/plain/dc10/rss091.xml')
  789. );
  790. $this->assertEquals(array('name'=>'Joe Bloggs'), $feed->getAuthor());
  791. }
  792. public function testGetsSingleAuthorFromRss10_Dc10()
  793. {
  794. $feed = Reader\Reader::importString(
  795. file_get_contents($this->_feedSamplePath.'/author/plain/dc10/rss10.xml')
  796. );
  797. $this->assertEquals(array('name'=>'Joe Bloggs'), $feed->getAuthor());
  798. }
  799. public function testGetsSingleAuthorFromRss090_Dc10()
  800. {
  801. $feed = Reader\Reader::importString(
  802. file_get_contents($this->_feedSamplePath.'/author/plain/dc10/rss090.xml')
  803. );
  804. $this->assertEquals(array('name'=>'Joe Bloggs'), $feed->getAuthor());
  805. }
  806. // DC 1.1
  807. public function testGetsSingleAuthorFromRss20_Dc11()
  808. {
  809. $feed = Reader\Reader::importString(
  810. file_get_contents($this->_feedSamplePath.'/author/plain/dc11/rss20.xml')
  811. );
  812. $this->assertEquals(array('name'=>'Joe Bloggs'), $feed->getAuthor());
  813. }
  814. public function testGetsSingleAuthorFromRss094_Dc11()
  815. {
  816. $feed = Reader\Reader::importString(
  817. file_get_contents($this->_feedSamplePath.'/author/plain/dc11/rss094.xml')
  818. );
  819. $this->assertEquals(array('name'=>'Joe Bloggs'), $feed->getAuthor());
  820. }
  821. public function testGetsSingleAuthorFromRss093_Dc11()
  822. {
  823. $feed = Reader\Reader::importString(
  824. file_get_contents($this->_feedSamplePath.'/author/plain/dc11/rss093.xml')
  825. );
  826. $this->assertEquals(array('name'=>'Joe Bloggs'), $feed->getAuthor());
  827. }
  828. public function testGetsSingleAuthorFromRss092_Dc11()
  829. {
  830. $feed = Reader\Reader::importString(
  831. file_get_contents($this->_feedSamplePath.'/author/plain/dc11/rss092.xml')
  832. );
  833. $this->assertEquals(array('name'=>'Joe Bloggs'), $feed->getAuthor());
  834. }
  835. public function testGetsSingleAuthorFromRss091_Dc11()
  836. {
  837. $feed = Reader\Reader::importString(
  838. file_get_contents($this->_feedSamplePath.'/author/plain/dc11/rss091.xml')
  839. );
  840. $this->assertEquals(array('name'=>'Joe Bloggs'), $feed->getAuthor());
  841. }
  842. public function testGetsSingleAuthorFromRss10_Dc11()
  843. {
  844. $feed = Reader\Reader::importString(
  845. file_get_contents($this->_feedSamplePath.'/author/plain/dc11/rss10.xml')
  846. );
  847. $this->assertEquals(array('name'=>'Joe Bloggs'), $feed->getAuthor());
  848. }
  849. public function testGetsSingleAuthorFromRss090_Dc11()
  850. {
  851. $feed = Reader\Reader::importString(
  852. file_get_contents($this->_feedSamplePath.'/author/plain/dc11/rss090.xml')
  853. );
  854. $this->assertEquals(array('name'=>'Joe Bloggs'), $feed->getAuthor());
  855. }
  856. // Missing Author
  857. public function testGetsSingleAuthorFromRss20_None()
  858. {
  859. $feed = Reader\Reader::importString(
  860. file_get_contents($this->_feedSamplePath.'/author/plain/none/rss20.xml')
  861. );
  862. $this->assertEquals(null, $feed->getAuthor());
  863. }
  864. public function testGetsSingleAuthorFromRss094_None()
  865. {
  866. $feed = Reader\Reader::importString(
  867. file_get_contents($this->_feedSamplePath.'/author/plain/none/rss094.xml')
  868. );
  869. $this->assertEquals(null, $feed->getAuthor());
  870. }
  871. public function testGetsSingleAuthorFromRss093_None()
  872. {
  873. $feed = Reader\Reader::importString(
  874. file_get_contents($this->_feedSamplePath.'/author/plain/none/rss093.xml')
  875. );
  876. $this->assertEquals(null, $feed->getAuthor());
  877. }
  878. public function testGetsSingleAuthorFromRss092_None()
  879. {
  880. $feed = Reader\Reader::importString(
  881. file_get_contents($this->_feedSamplePath.'/author/plain/none/rss092.xml')
  882. );
  883. $this->assertEquals(null, $feed->getAuthor());
  884. }
  885. public function testGetsSingleAuthorFromRss091_None()
  886. {
  887. $feed = Reader\Reader::importString(
  888. file_get_contents($this->_feedSamplePath.'/author/plain/none/rss091.xml')
  889. );
  890. $this->assertEquals(null, $feed->getAuthor());
  891. }
  892. public function testGetsSingleAuthorFromRss10_None()
  893. {
  894. $feed = Reader\Reader::importString(
  895. file_get_contents($this->_feedSamplePath.'/author/plain/none/rss10.xml')
  896. );
  897. $this->assertEquals(null, $feed->getAuthor());
  898. }
  899. public function testGetsSingleAuthorFromRss090_None()
  900. {
  901. $feed = Reader\Reader::importString(
  902. file_get_contents($this->_feedSamplePath.'/author/plain/none/rss090.xml')
  903. );
  904. $this->assertEquals(null, $feed->getAuthor());
  905. }
  906. /**
  907. * Get Copyright (Unencoded Text)
  908. */
  909. public function testGetsCopyrightFromRss20()
  910. {
  911. $feed = Reader\Reader::importString(
  912. file_get_contents($this->_feedSamplePath.'/copyright/plain/rss20.xml')
  913. );
  914. $this->assertEquals('Copyright 2008', $feed->getCopyright());
  915. }
  916. public function testGetsCopyrightFromRss094()
  917. {
  918. $feed = Reader\Reader::importString(
  919. file_get_contents($this->_feedSamplePath.'/copyright/plain/rss094.xml')
  920. );
  921. $this->assertEquals('Copyright 2008', $feed->getCopyright());
  922. }
  923. public function testGetsCopyrightFromRss093()
  924. {
  925. $feed = Reader\Reader::importString(
  926. file_get_contents($this->_feedSamplePath.'/copyright/plain/rss093.xml')
  927. );
  928. $this->assertEquals('Copyright 2008', $feed->getCopyright());
  929. }
  930. public function testGetsCopyrightFromRss092()
  931. {
  932. $feed = Reader\Reader::importString(
  933. file_get_contents($this->_feedSamplePath.'/copyright/plain/rss092.xml')
  934. );
  935. $this->assertEquals('Copyright 2008', $feed->getCopyright());
  936. }
  937. public function testGetsCopyrightFromRss091()
  938. {
  939. $feed = Reader\Reader::importString(
  940. file_get_contents($this->_feedSamplePath.'/copyright/plain/rss091.xml')
  941. );
  942. $this->assertEquals('Copyright 2008', $feed->getCopyright());
  943. }
  944. public function testGetsCopyrightFromRss10()
  945. {
  946. $feed = Reader\Reader::importString(
  947. file_get_contents($this->_feedSamplePath.'/copyright/plain/rss10.xml')
  948. );
  949. $this->assertEquals(null, $feed->getCopyright());
  950. }
  951. public function testGetsCopyrightFromRss090()
  952. {
  953. $feed = Reader\Reader::importString(
  954. file_get_contents($this->_feedSamplePath.'/copyright/plain/rss090.xml')
  955. );
  956. $this->assertEquals(null, $feed->getCopyright());
  957. }
  958. // DC 1.0
  959. public function testGetsCopyrightFromRss20_Dc10()
  960. {
  961. $feed = Reader\Reader::importString(
  962. file_get_contents($this->_feedSamplePath.'/copyright/plain/dc10/rss20.xml')
  963. );
  964. $this->assertEquals('Copyright 2008', $feed->getCopyright());
  965. }
  966. public function testGetsCopyrightFromRss094_Dc10()
  967. {
  968. $feed = Reader\Reader::importString(
  969. file_get_contents($this->_feedSamplePath.'/copyright/plain/dc10/rss094.xml')
  970. );
  971. $this->assertEquals('Copyright 2008', $feed->getCopyright());
  972. }
  973. public function testGetsCopyrightFromRss093_Dc10()
  974. {
  975. $feed = Reader\Reader::importString(
  976. file_get_contents($this->_feedSamplePath.'/copyright/plain/dc10/rss093.xml')
  977. );
  978. $this->assertEquals('Copyright 2008', $feed->getCopyright());
  979. }
  980. public function testGetsCopyrightFromRss092_Dc10()
  981. {
  982. $feed = Reader\Reader::importString(
  983. file_get_contents($this->_feedSamplePath.'/copyright/plain/dc10/rss092.xml')
  984. );
  985. $this->assertEquals('Copyright 2008', $feed->getCopyright());
  986. }
  987. public function testGetsCopyrightFromRss091_Dc10()
  988. {
  989. $feed = Reader\Reader::importString(
  990. file_get_contents($this->_feedSamplePath.'/copyright/plain/dc10/rss091.xml')
  991. );
  992. $this->assertEquals('Copyright 2008', $feed->getCopyright());
  993. }
  994. public function testGetsCopyrightFromRss10_Dc10()
  995. {
  996. $feed = Reader\Reader::importString(
  997. file_get_contents($this->_feedSamplePath.'/copyright/plain/dc10/rss10.xml')
  998. );
  999. $this->assertEquals('Copyright 2008', $feed->getCopyright());
  1000. }
  1001. public function testGetsCopyrightFromRss090_Dc10()
  1002. {
  1003. $feed = Reader\Reader::importString(
  1004. file_get_contents($this->_feedSamplePath.'/copyright/plain/dc10/rss090.xml')
  1005. );
  1006. $this->assertEquals('Copyright 2008', $feed->getCopyright());
  1007. }
  1008. // DC 1.1
  1009. public function testGetsCopyrightFromRss20_Dc11()
  1010. {
  1011. $feed = Reader\Reader::importString(
  1012. file_get_contents($this->_feedSamplePath.'/copyright/plain/dc11/rss20.xml')
  1013. );
  1014. $this->assertEquals('Copyright 2008', $feed->getCopyright());
  1015. }
  1016. public function testGetsCopyrightFromRss094_Dc11()
  1017. {
  1018. $feed = Reader\Reader::importString(
  1019. file_get_contents($this->_feedSamplePath.'/copyright/plain/dc11/rss094.xml')
  1020. );
  1021. $this->assertEquals('Copyright 2008', $feed->getCopyright());
  1022. }
  1023. public function testGetsCopyrightFromRss093_Dc11()
  1024. {
  1025. $feed = Reader\Reader::importString(
  1026. file_get_contents($this->_feedSamplePath.'/copyright/plain/dc11/rss093.xml')
  1027. );
  1028. $this->assertEquals('Copyright 2008', $feed->getCopyright());
  1029. }
  1030. public function testGetsCopyrightFromRss092_Dc11()
  1031. {
  1032. $feed = Reader\Reader::importString(
  1033. file_get_contents($this->_feedSamplePath.'/copyright/plain/dc11/rss092.xml')
  1034. );
  1035. $this->assertEquals('Copyright 2008', $feed->getCopyright());
  1036. }
  1037. public function testGetsCopyrightFromRss091_Dc11()
  1038. {
  1039. $feed = Reader\Reader::importString(
  1040. file_get_contents($this->_feedSamplePath.'/copyright/plain/dc11/rss091.xml')
  1041. );
  1042. $this->assertEquals('Copyright 2008', $feed->getCopyright());
  1043. }
  1044. public function testGetsCopyrightFromRss10_Dc11()
  1045. {
  1046. $feed = Reader\Reader::importString(
  1047. file_get_contents($this->_feedSamplePath.'/copyright/plain/dc11/rss10.xml')
  1048. );
  1049. $this->assertEquals('Copyright 2008', $feed->getCopyright());
  1050. }
  1051. public function testGetsCopyrightFromRss090_Dc11()
  1052. {
  1053. $feed = Reader\Reader::importString(
  1054. file_get_contents($this->_feedSamplePath.'/copyright/plain/dc11/rss090.xml')
  1055. );
  1056. $this->assertEquals('Copyright 2008', $feed->getCopyright());
  1057. }
  1058. // Missing Copyright
  1059. public function testGetsCopyrightFromRss20_None()
  1060. {
  1061. $feed = Reader\Reader::importString(
  1062. file_get_contents($this->_feedSamplePath.'/copyright/plain/none/rss20.xml')
  1063. );
  1064. $this->assertEquals(null, $feed->getCopyright());
  1065. }
  1066. public function testGetsCopyrightFromRss094_None()
  1067. {
  1068. $feed = Reader\Reader::importString(
  1069. file_get_contents($this->_feedSamplePath.'/copyright/plain/none/rss094.xml')
  1070. );
  1071. $this->assertEquals(null, $feed->getCopyright());
  1072. }
  1073. public function testGetsCopyrightFromRss093_None()
  1074. {
  1075. $feed = Reader\Reader::importString(
  1076. file_get_contents($this->_feedSamplePath.'/copyright/plain/none/rss093.xml')
  1077. );
  1078. $this->assertEquals(null, $feed->getCopyright());
  1079. }
  1080. public function testGetsCopyrightFromRss092_None()
  1081. {
  1082. $feed = Reader\Reader::importString(
  1083. file_get_contents($this->_feedSamplePath.'/copyright/plain/none/rss092.xml')
  1084. );
  1085. $this->assertEquals(null, $feed->getCopyright());
  1086. }
  1087. public function testGetsCopyrightFromRss091_None()
  1088. {
  1089. $feed = Reader\Reader::importString(
  1090. file_get_contents($this->_feedSamplePath.'/copyright/plain/none/rss091.xml')
  1091. );
  1092. $this->assertEquals(null, $feed->getCopyright());
  1093. }
  1094. public function testGetsCopyrightFromRss10_None()
  1095. {
  1096. $feed = Reader\Reader::importString(
  1097. file_get_contents($this->_feedSamplePath.'/copyright/plain/none/rss10.xml')
  1098. );
  1099. $this->assertEquals(null, $feed->getCopyright());
  1100. }
  1101. public function testGetsCopyrightFromRss090_None()
  1102. {
  1103. $feed = Reader\Reader::importString(
  1104. file_get_contents($this->_feedSamplePath.'/copyright/plain/none/rss090.xml')
  1105. );
  1106. $this->assertEquals(null, $feed->getCopyright());
  1107. }
  1108. /**
  1109. * Get Description (Unencoded Text)
  1110. */
  1111. public function testGetsDescriptionFromRss20()
  1112. {
  1113. $feed = Reader\Reader::importString(
  1114. file_get_contents($this->_feedSamplePath.'/description/plain/rss20.xml')
  1115. );
  1116. $this->assertEquals('My Description', $feed->getDescription());
  1117. }
  1118. public function testGetsDescriptionFromRss094()
  1119. {
  1120. $feed = Reader\Reader::importString(
  1121. file_get_contents($this->_feedSamplePath.'/description/plain/rss094.xml')
  1122. );
  1123. $this->assertEquals('My Description', $feed->getDescription());
  1124. }
  1125. public function testGetsDescriptionFromRss093()
  1126. {
  1127. $feed = Reader\Reader::importString(
  1128. file_get_contents($this->_feedSamplePath.'/description/plain/rss093.xml')
  1129. );
  1130. $this->assertEquals('My Description', $feed->getDescription());
  1131. }
  1132. public function testGetsDescriptionFromRss092()
  1133. {
  1134. $feed = Reader\Reader::importString(
  1135. file_get_contents($this->_feedSamplePath.'/description/plain/rss092.xml')
  1136. );
  1137. $this->assertEquals('My Description', $feed->getDescription());
  1138. }
  1139. public function testGetsDescriptionFromRss091()
  1140. {
  1141. $feed = Reader\Reader::importString(
  1142. file_get_contents($this->_feedSamplePath.'/description/plain/rss091.xml')
  1143. );
  1144. $this->assertEquals('My Description', $feed->getDescription());
  1145. }
  1146. public function testGetsDescriptionFromRss10()
  1147. {
  1148. $feed = Reader\Reader::importString(
  1149. file_get_contents($this->_feedSamplePath.'/description/plain/rss10.xml')
  1150. );
  1151. $this->assertEquals('My Description', $feed->getDescription());
  1152. }
  1153. public function testGetsDescriptionFromRss090()
  1154. {
  1155. $feed = Reader\Reader::importString(
  1156. file_get_contents($this->_feedSamplePath.'/description/plain/rss090.xml')
  1157. );
  1158. $this->assertEquals('My Description', $feed->getDescription());
  1159. }
  1160. // DC 1.0
  1161. public function testGetsDescriptionFromRss20_Dc10()
  1162. {
  1163. $feed = Reader\Reader::importString(
  1164. file_get_contents($this->_feedSamplePath.'/description/plain/dc10/rss20.xml')
  1165. );
  1166. $this->assertEquals('My Description', $feed->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. $this->assertEquals('My Description', $feed->getDescription());
  1174. }
  1175. public function testGetsDescriptionFromRss093_Dc10()
  1176. {
  1177. $feed = Reader\Reader::importString(
  1178. file_get_contents($this->_feedSamplePath.'/description/plain/dc10/rss093.xml')
  1179. );
  1180. $this->assertEquals('My Description', $feed->getDescription());
  1181. }
  1182. public function testGetsDescriptionFromRss092_Dc10()
  1183. {
  1184. $feed = Reader\Reader::importString(
  1185. file_get_contents($this->_feedSamplePath.'/description/plain/dc10/rss092.xml')
  1186. );
  1187. $this->assertEquals('My Description', $feed->getDescription());
  1188. }
  1189. public function testGetsDescriptionFromRss091_Dc10()
  1190. {
  1191. $feed = Reader\Reader::importString(
  1192. file_get_contents($this->_feedSamplePath.'/description/plain/dc10/rss091.xml')
  1193. );
  1194. $this->assertEquals('My Description', $feed->getDescription());
  1195. }
  1196. public function testGetsDescriptionFromRss10_Dc10()
  1197. {
  1198. $feed = Reader\Reader::importString(
  1199. file_get_contents($this->_feedSamplePath.'/description/plain/dc10/rss10.xml')
  1200. );
  1201. $this->assertEquals('My Description', $feed->getDescription());
  1202. }
  1203. public function testGetsDescriptionFromRss090_Dc10()
  1204. {
  1205. $feed = Reader\Reader::importString(
  1206. file_get_contents($this->_feedSamplePath.'/description/plain/dc10/rss090.xml')
  1207. );
  1208. $this->assertEquals('My Description', $feed->getDescription());
  1209. }
  1210. // DC 1.1
  1211. public function testGetsDescriptionFromRss20_Dc11()
  1212. {
  1213. $feed = Reader\Reader::importString(
  1214. file_get_contents($this->_feedSamplePath.'/description/plain/dc11/rss20.xml')
  1215. );
  1216. $this->assertEquals('My Description', $feed->getDescription());
  1217. }
  1218. public function testGetsDescriptionFromRss094_Dc11()
  1219. {
  1220. $feed = Reader\Reader::importString(
  1221. file_get_contents($this->_feedSamplePath.'/description/plain/dc11/rss094.xml')
  1222. );
  1223. $this->assertEquals('My Description', $feed->getDescription());
  1224. }
  1225. public function testGetsDescriptionFromRss093_Dc11()
  1226. {
  1227. $feed = Reader\Reader::importString(
  1228. file_get_contents($this->_feedSamplePath.'/description/plain/dc11/rss093.xml')
  1229. );
  1230. $this->assertEquals('My Description', $feed->getDescription());
  1231. }
  1232. public function testGetsDescriptionFromRss092_Dc11()
  1233. {
  1234. $feed = Reader\Reader::importString(
  1235. file_get_contents($this->_feedSamplePath.'/description/plain/dc11/rss092.xml')
  1236. );
  1237. $this->assertEquals('My Description', $feed->getDescription());
  1238. }
  1239. public function testGetsDescriptionFromRss091_Dc11()
  1240. {
  1241. $feed = Reader\Reader::importString(
  1242. file_get_contents($this->_feedSamplePath.'/description/plain/dc11/rss091.xml')
  1243. );
  1244. $this->assertEquals('My Description', $feed->getDescription());
  1245. }
  1246. public function testGetsDescriptionFromRss10_Dc11()
  1247. {
  1248. $feed = Reader\Reader::importString(
  1249. file_get_contents($this->_feedSamplePath.'/description/plain/dc11/rss10.xml')
  1250. );
  1251. $this->assertEquals('My Description', $feed->getDescription());
  1252. }
  1253. public function testGetsDescriptionFromRss090_Dc11()
  1254. {
  1255. $feed = Reader\Reader::importString(
  1256. file_get_contents($this->_feedSamplePath.'/description/plain/dc11/rss090.xml')
  1257. );
  1258. $this->assertEquals('My Description', $feed->getDescription());
  1259. }
  1260. // Missing Description
  1261. public function testGetsDescriptionFromRss20_None()
  1262. {
  1263. $feed = Reader\Reader::importString(
  1264. file_get_contents($this->_feedSamplePath.'/description/plain/none/rss20.xml')
  1265. );
  1266. $this->assertEquals(null, $feed->getDescription());
  1267. }
  1268. public function testGetsDescriptionFromRss094_None()
  1269. {
  1270. $feed = Reader\Reader::importString(
  1271. file_get_contents($this->_feedSamplePath.'/description/plain/none/rss094.xml')
  1272. );
  1273. $this->assertEquals(null, $feed->getDescription());
  1274. }
  1275. public function testGetsDescriptionFromRss093_None()
  1276. {
  1277. $feed = Reader\Reader::importString(
  1278. file_get_contents($this->_feedSamplePath.'/description/plain/none/rss093.xml')
  1279. );
  1280. $this->assertEquals(null, $feed->getDescription());
  1281. }
  1282. public function testGetsDescriptionFromRss092_None()
  1283. {
  1284. $feed = Reader\Reader::importString(
  1285. file_get_contents($this->_feedSamplePath.'/description/plain/none/rss092.xml')
  1286. );
  1287. $this->assertEquals(null, $feed->getDescription());
  1288. }
  1289. public function testGetsDescriptionFromRss091_None()
  1290. {
  1291. $feed = Reader\Reader::importString(
  1292. file_get_contents($this->_feedSamplePath.'/description/plain/none/rss091.xml')
  1293. );
  1294. $this->assertEquals(null, $feed->getDescription());
  1295. }
  1296. public function testGetsDescriptionFromRss10_None()
  1297. {
  1298. $feed = Reader\Reader::importString(
  1299. file_get_contents($this->_feedSamplePath.'/description/plain/none/rss10.xml')
  1300. );
  1301. $this->assertEquals(null, $feed->getDescription());
  1302. }
  1303. public function testGetsDescriptionFromRss090_None()
  1304. {
  1305. $feed = Reader\Reader::importString(
  1306. file_get_contents($this->_feedSamplePath.'/description/plain/none/rss090.xml')
  1307. );
  1308. $this->assertEquals(null, $feed->getDescription());
  1309. }
  1310. /**
  1311. * Get Language (Unencoded Text)
  1312. */
  1313. public function testGetsLanguageFromRss20()
  1314. {
  1315. $feed = Reader\Reader::importString(
  1316. file_get_contents($this->_feedSamplePath.'/language/plain/rss20.xml')
  1317. );
  1318. $this->assertEquals('en-GB', $feed->getLanguage());
  1319. }
  1320. public function testGetsLanguageFromRss094()
  1321. {
  1322. $feed = Reader\Reader::importString(
  1323. file_get_contents($this->_feedSamplePath.'/language/plain/rss094.xml')
  1324. );
  1325. $this->assertEquals('en-GB', $feed->getLanguage());
  1326. }
  1327. public function testGetsLanguageFromRss093()
  1328. {
  1329. $feed = Reader\Reader::importString(
  1330. file_get_contents($this->_feedSamplePath.'/language/plain/rss093.xml')
  1331. );
  1332. $this->assertEquals('en-GB', $feed->getLanguage());
  1333. }
  1334. public function testGetsLanguageFromRss092()
  1335. {
  1336. $feed = Reader\Reader::importString(
  1337. file_get_contents($this->_feedSamplePath.'/language/plain/rss092.xml')
  1338. );
  1339. $this->assertEquals('en-GB', $feed->getLanguage());
  1340. }
  1341. public function testGetsLanguageFromRss091()
  1342. {
  1343. $feed = Reader\Reader::importString(
  1344. file_get_contents($this->_feedSamplePath.'/language/plain/rss091.xml')
  1345. );
  1346. $this->assertEquals('en-GB', $feed->getLanguage());
  1347. }
  1348. public function testGetsLanguageFromRss10()
  1349. {
  1350. $feed = Reader\Reader::importString(
  1351. file_get_contents($this->_feedSamplePath.'/language/plain/rss10.xml')
  1352. );
  1353. $this->assertEquals(null, $feed->getLanguage());
  1354. }
  1355. public function testGetsLanguageFromRss090()
  1356. {
  1357. $feed = Reader\Reader::importString(
  1358. file_get_contents($this->_feedSamplePath.'/language/plain/rss090.xml')
  1359. );
  1360. $this->assertEquals(null, $feed->getLanguage());
  1361. }
  1362. // DC 1.0
  1363. public function testGetsLanguageFromRss20_Dc10()
  1364. {
  1365. $feed = Reader\Reader::importString(
  1366. file_get_contents($this->_feedSamplePath.'/language/plain/dc10/rss20.xml')
  1367. );
  1368. $this->assertEquals('en-GB', $feed->getLanguage());
  1369. }
  1370. public function testGetsLanguageFromRss094_Dc10()
  1371. {
  1372. $feed = Reader\Reader::importString(
  1373. file_get_contents($this->_feedSamplePath.'/language/plain/dc10/rss094.xml')
  1374. );
  1375. $this->assertEquals('en-GB', $feed->getLanguage());
  1376. }
  1377. public function testGetsLanguageFromRss093_Dc10()
  1378. {
  1379. $feed = Reader\Reader::importString(
  1380. file_get_contents($this->_feedSamplePath.'/language/plain/dc10/rss093.xml')
  1381. );
  1382. $this->assertEquals('en-GB', $feed->getLanguage());
  1383. }
  1384. public function testGetsLanguageFromRss092_Dc10()
  1385. {
  1386. $feed = Reader\Reader::importString(
  1387. file_get_contents($this->_feedSamplePath.'/language/plain/dc10/rss092.xml')
  1388. );
  1389. $this->assertEquals('en-GB', $feed->getLanguage());
  1390. }
  1391. public function testGetsLanguageFromRss091_Dc10()
  1392. {
  1393. $feed = Reader\Reader::importString(
  1394. file_get_contents($this->_feedSamplePath.'/language/plain/dc10/rss091.xml')
  1395. );
  1396. $this->assertEquals('en-GB', $feed->getLanguage());
  1397. }
  1398. public function testGetsLanguageFromRss10_Dc10()
  1399. {
  1400. $feed = Reader\Reader::importString(
  1401. file_get_contents($this->_feedSamplePath.'/language/plain/dc10/rss10.xml')
  1402. );
  1403. $this->assertEquals('en-GB', $feed->getLanguage());
  1404. }
  1405. public function testGetsLanguageFromRss090_Dc10()
  1406. {
  1407. $feed = Reader\Reader::importString(
  1408. file_get_contents($this->_feedSamplePath.'/language/plain/dc10/rss090.xml')
  1409. );
  1410. $this->assertEquals('en-GB', $feed->getLanguage());
  1411. }
  1412. // DC 1.1
  1413. public function testGetsLanguageFromRss20_Dc11()
  1414. {
  1415. $feed = Reader\Reader::importString(
  1416. file_get_contents($this->_feedSamplePath.'/language/plain/dc11/rss20.xml')
  1417. );
  1418. $this->assertEquals('en-GB', $feed->getLanguage());
  1419. }
  1420. public function testGetsLanguageFromRss094_Dc11()
  1421. {
  1422. $feed = Reader\Reader::importString(
  1423. file_get_contents($this->_feedSamplePath.'/language/plain/dc11/rss094.xml')
  1424. );
  1425. $this->assertEquals('en-GB', $feed->getLanguage());
  1426. }
  1427. public function testGetsLanguageFromRss093_Dc11()
  1428. {
  1429. $feed = Reader\Reader::importString(
  1430. file_get_contents($this->_feedSamplePath.'/language/plain/dc11/rss093.xml')
  1431. );
  1432. $this->assertEquals('en-GB', $feed->getLanguage());
  1433. }
  1434. public function testGetsLanguageFromRss092_Dc11()
  1435. {
  1436. $feed = Reader\Reader::importString(
  1437. file_get_contents($this->_feedSamplePath.'/language/plain/dc11/rss092.xml')
  1438. );
  1439. $this->assertEquals('en-GB', $feed->getLanguage());
  1440. }
  1441. public function testGetsLanguageFromRss091_Dc11()
  1442. {
  1443. $feed = Reader\Reader::importString(
  1444. file_get_contents($this->_feedSamplePath.'/language/plain/dc11/rss091.xml')
  1445. );
  1446. $this->assertEquals('en-GB', $feed->getLanguage());
  1447. }
  1448. public function testGetsLanguageFromRss10_Dc11()
  1449. {
  1450. $feed = Reader\Reader::importString(
  1451. file_get_contents($this->_feedSamplePath.'/language/plain/dc11/rss10.xml')
  1452. );
  1453. $this->assertEquals('en-GB', $feed->getLanguage());
  1454. }
  1455. public function testGetsLanguageFromRss090_Dc11()
  1456. {
  1457. $feed = Reader\Reader::importString(
  1458. file_get_contents($this->_feedSamplePath.'/language/plain/dc11/rss090.xml')
  1459. );
  1460. $this->assertEquals('en-GB', $feed->getLanguage());
  1461. }
  1462. // Other
  1463. public function testGetsLanguageFromRss10_XmlLang()
  1464. {
  1465. $feed = Reader\Reader::importString(
  1466. file_get_contents($this->_feedSamplePath.'/language/plain/rdf/rss10.xml')
  1467. );
  1468. $this->assertEquals('en', $feed->getLanguage());
  1469. }
  1470. // Missing Language
  1471. public function testGetsLanguageFromRss20_None()
  1472. {
  1473. $feed = Reader\Reader::importString(
  1474. file_get_contents($this->_feedSamplePath.'/language/plain/none/rss20.xml')
  1475. );
  1476. $this->assertEquals(null, $feed->getLanguage());
  1477. }
  1478. public function testGetsLanguageFromRss094_None()
  1479. {
  1480. $feed = Reader\Reader::importString(
  1481. file_get_contents($this->_feedSamplePath.'/language/plain/none/rss094.xml')
  1482. );
  1483. $this->assertEquals(null, $feed->getLanguage());
  1484. }
  1485. public function testGetsLanguageFromRss093_None()
  1486. {
  1487. $feed = Reader\Reader::importString(
  1488. file_get_contents($this->_feedSamplePath.'/language/plain/none/rss093.xml')
  1489. );
  1490. $this->assertEquals(null, $feed->getLanguage());
  1491. }
  1492. public function testGetsLanguageFromRss092_None()
  1493. {
  1494. $feed = Reader\Reader::importString(
  1495. file_get_contents($this->_feedSamplePath.'/language/plain/none/rss092.xml')
  1496. );
  1497. $this->assertEquals(null, $feed->getLanguage());
  1498. }
  1499. public function testGetsLanguageFromRss091_None()
  1500. {
  1501. $feed = Reader\Reader::importString(
  1502. file_get_contents($this->_feedSamplePath.'/language/plain/none/rss091.xml')
  1503. );
  1504. $this->assertEquals(null, $feed->getLanguage());
  1505. }
  1506. public function testGetsLanguageFromRss10_None()
  1507. {
  1508. $feed = Reader\Reader::importString(
  1509. file_get_contents($this->_feedSamplePath.'/language/plain/none/rss10.xml')
  1510. );
  1511. $this->assertEquals(null, $feed->getLanguage());
  1512. }
  1513. public function testGetsLanguageFromRss090_None()
  1514. {
  1515. $feed = Reader\Reader::importString(
  1516. file_get_contents($this->_feedSamplePath.'/language/plain/none/rss090.xml')
  1517. );
  1518. $this->assertEquals(null, $feed->getLanguage());
  1519. }
  1520. /**
  1521. * Get Link (Unencoded Text)
  1522. */
  1523. public function testGetsLinkFromRss20()
  1524. {
  1525. $feed = Reader\Reader::importString(
  1526. file_get_contents($this->_feedSamplePath.'/link/plain/rss20.xml')
  1527. );
  1528. $this->assertEquals('http://www.example.com', $feed->getLink());
  1529. }
  1530. public function testGetsLinkFromRss094()
  1531. {
  1532. $feed = Reader\Reader::importString(
  1533. file_get_contents($this->_feedSamplePath.'/link/plain/rss094.xml')
  1534. );
  1535. $this->assertEquals('http://www.example.com', $feed->getLink());
  1536. }
  1537. public function testGetsLinkFromRss093()
  1538. {
  1539. $feed = Reader\Reader::importString(
  1540. file_get_contents($this->_feedSamplePath.'/link/plain/rss093.xml')
  1541. );
  1542. $this->assertEquals('http://www.example.com', $feed->getLink());
  1543. }
  1544. public function testGetsLinkFromRss092()
  1545. {
  1546. $feed = Reader\Reader::importString(
  1547. file_get_contents($this->_feedSamplePath.'/link/plain/rss092.xml')
  1548. );
  1549. $this->assertEquals('http://www.example.com', $feed->getLink());
  1550. }
  1551. public function testGetsLinkFromRss091()
  1552. {
  1553. $feed = Reader\Reader::importString(
  1554. file_get_contents($this->_feedSamplePath.'/link/plain/rss091.xml')
  1555. );
  1556. $this->assertEquals('http://www.example.com', $feed->getLink());
  1557. }
  1558. public function testGetsLinkFromRss10()
  1559. {
  1560. $feed = Reader\Reader::importString(
  1561. file_get_contents($this->_feedSamplePath.'/link/plain/rss10.xml')
  1562. );
  1563. $this->assertEquals('http://www.example.com', $feed->getLink());
  1564. }
  1565. public function testGetsLinkFromRss090()
  1566. {
  1567. $feed = Reader\Reader::importString(
  1568. file_get_contents($this->_feedSamplePath.'/link/plain/rss090.xml')
  1569. );
  1570. $this->assertEquals('http://www.example.com', $feed->getLink());
  1571. }
  1572. // Missing Link
  1573. public function testGetsLinkFromRss20_None()
  1574. {
  1575. $feed = Reader\Reader::importString(
  1576. file_get_contents($this->_feedSamplePath.'/link/plain/none/rss20.xml')
  1577. );
  1578. $this->assertEquals(null, $feed->getLink());
  1579. }
  1580. public function testGetsLinkFromRss094_None()
  1581. {
  1582. $feed = Reader\Reader::importString(
  1583. file_get_contents($this->_feedSamplePath.'/link/plain/none/rss094.xml')
  1584. );
  1585. $this->assertEquals(null, $feed->getLink());
  1586. }
  1587. public function testGetsLinkFromRss093_None()
  1588. {
  1589. $feed = Reader\Reader::importString(
  1590. file_get_contents($this->_feedSamplePath.'/link/plain/none/rss093.xml')
  1591. );
  1592. $this->assertEquals(null, $feed->getLink());
  1593. }
  1594. public function testGetsLinkFromRss092_None()
  1595. {
  1596. $feed = Reader\Reader::importString(
  1597. file_get_contents($this->_feedSamplePath.'/link/plain/none/rss092.xml')
  1598. );
  1599. $this->assertEquals(null, $feed->getLink());
  1600. }
  1601. public function testGetsLinkFromRss091_None()
  1602. {
  1603. $feed = Reader\Reader::importString(
  1604. file_get_contents($this->_feedSamplePath.'/link/plain/none/rss091.xml')
  1605. );
  1606. $this->assertEquals(null, $feed->getLink());
  1607. }
  1608. public function testGetsLinkFromRss10_None()
  1609. {
  1610. $feed = Reader\Reader::importString(
  1611. file_get_contents($this->_feedSamplePath.'/link/plain/none/rss10.xml')
  1612. );
  1613. $this->assertEquals(null, $feed->getLink());
  1614. }
  1615. public function testGetsLinkFromRss090_None()
  1616. {
  1617. $feed = Reader\Reader::importString(
  1618. file_get_contents($this->_feedSamplePath.'/link/plain/none/rss090.xml')
  1619. );
  1620. $this->assertEquals(null, $feed->getLink());
  1621. }
  1622. /**
  1623. * Implements Countable
  1624. */
  1625. public function testCountableInterface()
  1626. {
  1627. $feed = Reader\Reader::importString(
  1628. file_get_contents($this->_feedSamplePath.'/link/plain/none/rss090.xml')
  1629. );
  1630. $this->assertEquals(0, count($feed));
  1631. }
  1632. /**
  1633. * Get Feed Link (Unencoded Text)
  1634. */
  1635. public function testGetsFeedLinkFromRss20()
  1636. {
  1637. $feed = Reader\Reader::importString(
  1638. file_get_contents($this->_feedSamplePath.'/feedlink/plain/rss20.xml')
  1639. );
  1640. $this->assertEquals('http://www.example.com/feed/rss', $feed->getFeedLink());
  1641. }
  1642. public function testGetsOriginalSourceUriIfFeedLinkNotAvailableFromFeed()
  1643. {
  1644. $feed = Reader\Reader::importString(
  1645. file_get_contents($this->_feedSamplePath.'/feedlink/plain/rss20_NoFeedLink.xml')
  1646. );
  1647. $feed->setOriginalSourceUri('http://www.example.com/feed/rss');
  1648. $this->assertEquals('http://www.example.com/feed/rss', $feed->getFeedLink());
  1649. }
  1650. public function testGetsFeedLinkFromRss094()
  1651. {
  1652. $feed = Reader\Reader::importString(
  1653. file_get_contents($this->_feedSamplePath.'/feedlink/plain/rss094.xml')
  1654. );
  1655. $this->assertEquals('http://www.example.com/feed/rss', $feed->getFeedLink());
  1656. }
  1657. public function testGetsFeedLinkFromRss093()
  1658. {
  1659. $feed = Reader\Reader::importString(
  1660. file_get_contents($this->_feedSamplePath.'/feedlink/plain/rss093.xml')
  1661. );
  1662. $this->assertEquals('http://www.example.com/feed/rss', $feed->getFeedLink());
  1663. }
  1664. public function testGetsFeedLinkFromRss092()
  1665. {
  1666. $feed = Reader\Reader::importString(
  1667. file_get_contents($this->_feedSamplePath.'/feedlink/plain/rss092.xml')
  1668. );
  1669. $this->assertEquals('http://www.example.com/feed/rss', $feed->getFeedLink());
  1670. }
  1671. public function testGetsFeedLinkFromRss091()
  1672. {
  1673. $feed = Reader\Reader::importString(
  1674. file_get_contents($this->_feedSamplePath.'/feedlink/plain/rss091.xml')
  1675. );
  1676. $this->assertEquals('http://www.example.com/feed/rss', $feed->getFeedLink());
  1677. }
  1678. public function testGetsFeedLinkFromRss10()
  1679. {
  1680. $feed = Reader\Reader::importString(
  1681. file_get_contents($this->_feedSamplePath.'/feedlink/plain/rss10.xml')
  1682. );
  1683. $this->assertEquals('http://www.example.com/feed/rss', $feed->getFeedLink());
  1684. }
  1685. public function testGetsFeedLinkFromRss090()
  1686. {
  1687. $feed = Reader\Reader::importString(
  1688. file_get_contents($this->_feedSamplePath.'/feedlink/plain/rss090.xml')
  1689. );
  1690. $this->assertEquals('http://www.example.com/feed/rss', $feed->getFeedLink());
  1691. }
  1692. // Missing Feed Link
  1693. public function testGetsFeedLinkFromRss20_None()
  1694. {
  1695. $feed = Reader\Reader::importString(
  1696. file_get_contents($this->_feedSamplePath.'/feedlink/plain/none/rss20.xml')
  1697. );
  1698. $this->assertEquals(null, $feed->getFeedLink());
  1699. }
  1700. public function testGetsFeedLinkFromRss094_None()
  1701. {
  1702. $feed = Reader\Reader::importString(
  1703. file_get_contents($this->_feedSamplePath.'/feedlink/plain/none/rss094.xml')
  1704. );
  1705. $this->assertEquals(null, $feed->getFeedLink());
  1706. }
  1707. public function testGetsFeedLinkFromRss093_None()
  1708. {
  1709. $feed = Reader\Reader::importString(
  1710. file_get_contents($this->_feedSamplePath.'/feedlink/plain/none/rss093.xml')
  1711. );
  1712. $this->assertEquals(null, $feed->getFeedLink());
  1713. }
  1714. public function testGetsFeedLinkFromRss092_None()
  1715. {
  1716. $feed = Reader\Reader::importString(
  1717. file_get_contents($this->_feedSamplePath.'/feedlink/plain/none/rss092.xml')
  1718. );
  1719. $this->assertEquals(null, $feed->getFeedLink());
  1720. }
  1721. public function testGetsFeedLinkFromRss091_None()
  1722. {
  1723. $feed = Reader\Reader::importString(
  1724. file_get_contents($this->_feedSamplePath.'/feedlink/plain/none/rss091.xml')
  1725. );
  1726. $this->assertEquals(null, $feed->getFeedLink());
  1727. }
  1728. public function testGetsFeedLinkFromRss10_None()
  1729. {
  1730. $feed = Reader\Reader::importString(
  1731. file_get_contents($this->_feedSamplePath.'/feedlink/plain/none/rss10.xml')
  1732. );
  1733. $this->assertEquals(null, $feed->getFeedLink());
  1734. }
  1735. public function testGetsFeedLinkFromRss090_None()
  1736. {
  1737. $feed = Reader\Reader::importString(
  1738. file_get_contents($this->_feedSamplePath.'/feedlink/plain/none/rss090.xml')
  1739. );
  1740. $this->assertEquals(null, $feed->getFeedLink());
  1741. }
  1742. /**
  1743. * Get Generator (Unencoded Text)
  1744. */
  1745. public function testGetsGeneratorFromRss20()
  1746. {
  1747. $feed = Reader\Reader::importString(
  1748. file_get_contents($this->_feedSamplePath.'/generator/plain/rss20.xml')
  1749. );
  1750. $this->assertEquals('Zend_Feed_Writer', $feed->getGenerator());
  1751. }
  1752. public function testGetsGeneratorFromRss094()
  1753. {
  1754. $feed = Reader\Reader::importString(
  1755. file_get_contents($this->_feedSamplePath.'/generator/plain/rss094.xml')
  1756. );
  1757. $this->assertEquals('Zend_Feed_Writer', $feed->getGenerator());
  1758. }
  1759. public function testGetsGeneratorFromRss093()
  1760. {
  1761. $feed = Reader\Reader::importString(
  1762. file_get_contents($this->_feedSamplePath.'/generator/plain/rss093.xml')
  1763. );
  1764. $this->assertEquals('Zend_Feed_Writer', $feed->getGenerator());
  1765. }
  1766. public function testGetsGeneratorFromRss092()
  1767. {
  1768. $feed = Reader\Reader::importString(
  1769. file_get_contents($this->_feedSamplePath.'/generator/plain/rss092.xml')
  1770. );
  1771. $this->assertEquals('Zend_Feed_Writer', $feed->getGenerator());
  1772. }
  1773. public function testGetsGeneratorFromRss091()
  1774. {
  1775. $feed = Reader\Reader::importString(
  1776. file_get_contents($this->_feedSamplePath.'/generator/plain/rss091.xml')
  1777. );
  1778. $this->assertEquals('Zend_Feed_Writer', $feed->getGenerator());
  1779. }
  1780. public function testGetsGeneratorFromRss10()
  1781. {
  1782. $feed = Reader\Reader::importString(
  1783. file_get_contents($this->_feedSamplePath.'/generator/plain/rss10.xml')
  1784. );
  1785. $this->assertEquals('Zend_Feed_Writer', $feed->getGenerator());
  1786. }
  1787. public function testGetsGeneratorFromRss090()
  1788. {
  1789. $feed = Reader\Reader::importString(
  1790. file_get_contents($this->_feedSamplePath.'/generator/plain/rss090.xml')
  1791. );
  1792. $this->assertEquals('Zend_Feed_Writer', $feed->getGenerator());
  1793. }
  1794. // Missing Generator
  1795. public function testGetsGeneratorFromRss20_None()
  1796. {
  1797. $feed = Reader\Reader::importString(
  1798. file_get_contents($this->_feedSamplePath.'/generator/plain/none/rss20.xml')
  1799. );
  1800. $this->assertEquals(null, $feed->getGenerator());
  1801. }
  1802. public function testGetsGeneratorFromRss094_None()
  1803. {
  1804. $feed = Reader\Reader::importString(
  1805. file_get_contents($this->_feedSamplePath.'/generator/plain/none/rss094.xml')
  1806. );
  1807. $this->assertEquals(null, $feed->getGenerator());
  1808. }
  1809. public function testGetsGeneratorFromRss093_None()
  1810. {
  1811. $feed = Reader\Reader::importString(
  1812. file_get_contents($this->_feedSamplePath.'/generator/plain/none/rss093.xml')
  1813. );
  1814. $this->assertEquals(null, $feed->getGenerator());
  1815. }
  1816. public function testGetsGeneratorFromRss092_None()
  1817. {
  1818. $feed = Reader\Reader::importString(
  1819. file_get_contents($this->_feedSamplePath.'/generator/plain/none/rss092.xml')
  1820. );
  1821. $this->assertEquals(null, $feed->getGenerator());
  1822. }
  1823. public function testGetsGeneratorFromRss091_None()
  1824. {
  1825. $feed = Reader\Reader::importString(
  1826. file_get_contents($this->_feedSamplePath.'/generator/plain/none/rss091.xml')
  1827. );
  1828. $this->assertEquals(null, $feed->getGenerator());
  1829. }
  1830. public function testGetsGeneratorFromRss10_None()
  1831. {
  1832. $feed = Reader\Reader::importString(
  1833. file_get_contents($this->_feedSamplePath.'/generator/plain/none/rss10.xml')
  1834. );
  1835. $this->assertEquals(null, $feed->getGenerator());
  1836. }
  1837. public function testGetsGeneratorFromRss090_None()
  1838. {
  1839. $feed = Reader\Reader::importString(
  1840. file_get_contents($this->_feedSamplePath.'/generator/plain/none/rss090.xml')
  1841. );
  1842. $this->assertEquals(null, $feed->getGenerator());
  1843. }
  1844. /**
  1845. * Get Last Build Date (Unencoded Text)
  1846. */
  1847. public function testGetsLastBuildDateFromRss20()
  1848. {
  1849. $feed = Reader\Reader::importString(
  1850. file_get_contents($this->_feedSamplePath.'/lastbuilddate/plain/rss20.xml')
  1851. );
  1852. $edate = new Date\Date;
  1853. $edate->set('2009-03-07T08:03:50Z', Date\Date::ISO_8601);
  1854. $this->assertTrue($edate->equals($feed->getLastBuildDate()));
  1855. }
  1856. public function testGetsLastBuildDateFromRss20_None()
  1857. {
  1858. $feed = Reader\Reader::importString(
  1859. file_get_contents($this->_feedSamplePath.'/lastbuilddate/plain/none/rss20.xml')
  1860. );
  1861. $this->assertEquals(null, $feed->getLastBuildDate());
  1862. }
  1863. /**
  1864. * Get Date Modified (Unencoded Text)
  1865. */
  1866. public function testGetsDateModifiedFromRss20()
  1867. {
  1868. $feed = Reader\Reader::importString(
  1869. file_get_contents($this->_feedSamplePath.'/datemodified/plain/rss20.xml')
  1870. );
  1871. $edate = new Date\Date;
  1872. $edate->set('2009-03-07T08:03:50Z', Date\Date::ISO_8601);
  1873. $this->assertTrue($edate->equals($feed->getDateModified()));
  1874. }
  1875. /**
  1876. * @group ZF-8702
  1877. */
  1878. public function testParsesCorrectDateIfMissingOffsetWhenSystemUsesUSLocale()
  1879. {
  1880. $locale = new \Zend\Locale\Locale('en_US');
  1881. \Zend\Registry::set('Zend_Locale', $locale);
  1882. $feed = Reader\Reader::importString(
  1883. file_get_contents($this->_feedSamplePath.'/datemodified/plain/rss20_en_US.xml')
  1884. );
  1885. $fdate = $feed->getDateModified();
  1886. $edate = new Date\Date;
  1887. $edate->set('2010-01-04T02:14:00-0600', Date\Date::ISO_8601);
  1888. \Zend\Registry::getInstance()->offsetUnset('Zend_Locale');
  1889. $this->assertTrue($edate->equals($fdate));
  1890. }
  1891. // DC 1.0
  1892. public function testGetsDateModifiedFromRss20_Dc10()
  1893. {
  1894. $feed = Reader\Reader::importString(
  1895. file_get_contents($this->_feedSamplePath.'/datemodified/plain/dc10/rss20.xml')
  1896. );
  1897. $edate = new Date\Date;
  1898. $edate->set('2009-03-07T08:03:50Z', Date\Date::ISO_8601);
  1899. $this->assertTrue($edate->equals($feed->getDateModified()));
  1900. }
  1901. public function testGetsDateModifiedFromRss094_Dc10()
  1902. {
  1903. $feed = Reader\Reader::importString(
  1904. file_get_contents($this->_feedSamplePath.'/datemodified/plain/dc10/rss094.xml')
  1905. );
  1906. $edate = new Date\Date;
  1907. $edate->set('2009-03-07T08:03:50Z', Date\Date::ISO_8601);
  1908. $this->assertTrue($edate->equals($feed->getDateModified()));
  1909. }
  1910. public function testGetsDateModifiedFromRss093_Dc10()
  1911. {
  1912. $feed = Reader\Reader::importString(
  1913. file_get_contents($this->_feedSamplePath.'/datemodified/plain/dc10/rss093.xml')
  1914. );
  1915. $edate = new Date\Date;
  1916. $edate->set('2009-03-07T08:03:50Z', Date\Date::ISO_8601);
  1917. $this->assertTrue($edate->equals($feed->getDateModified()));
  1918. }
  1919. public function testGetsDateModifiedFromRss092_Dc10()
  1920. {
  1921. $feed = Reader\Reader::importString(
  1922. file_get_contents($this->_feedSamplePath.'/datemodified/plain/dc10/rss092.xml')
  1923. );
  1924. $edate = new Date\Date;
  1925. $edate->set('2009-03-07T08:03:50Z', Date\Date::ISO_8601);
  1926. $this->assertTrue($edate->equals($feed->getDateModified()));
  1927. }
  1928. public function testGetsDateModifiedFromRss091_Dc10()
  1929. {
  1930. $feed = Reader\Reader::importString(
  1931. file_get_contents($this->_feedSamplePath.'/datemodified/plain/dc10/rss091.xml')
  1932. );
  1933. $edate = new Date\Date;
  1934. $edate->set('2009-03-07T08:03:50Z', Date\Date::ISO_8601);
  1935. $this->assertTrue($edate->equals($feed->getDateModified()));
  1936. }
  1937. public function testGetsDateModifiedFromRss10_Dc10()
  1938. {
  1939. $feed = Reader\Reader::importString(
  1940. file_get_contents($this->_feedSamplePath.'/datemodified/plain/dc10/rss10.xml')
  1941. );
  1942. $edate = new Date\Date;
  1943. $edate->set('2009-03-07T08:03:50Z', Date\Date::ISO_8601);
  1944. $this->assertTrue($edate->equals($feed->getDateModified()));
  1945. }
  1946. public function testGetsDateModifiedFromRss090_Dc10()
  1947. {
  1948. $feed = Reader\Reader::importString(
  1949. file_get_contents($this->_feedSamplePath.'/datemodified/plain/dc10/rss090.xml')
  1950. );
  1951. $edate = new Date\Date;
  1952. $edate->set('2009-03-07T08:03:50Z', Date\Date::ISO_8601);
  1953. $this->assertTrue($edate->equals($feed->getDateModified()));
  1954. }
  1955. // DC 1.1
  1956. public function testGetsDateModifiedFromRss20_Dc11()
  1957. {
  1958. $feed = Reader\Reader::importString(
  1959. file_get_contents($this->_feedSamplePath.'/datemodified/plain/dc11/rss20.xml')
  1960. );
  1961. $edate = new Date\Date;
  1962. $edate->set('2009-03-07T08:03:50Z', Date\Date::ISO_8601);
  1963. $this->assertTrue($edate->equals($feed->getDateModified()));
  1964. }
  1965. public function testGetsDateModifiedFromRss094_Dc11()
  1966. {
  1967. $feed = Reader\Reader::importString(
  1968. file_get_contents($this->_feedSamplePath.'/datemodified/plain/dc11/rss094.xml')
  1969. );
  1970. $edate = new Date\Date;
  1971. $edate->set('2009-03-07T08:03:50Z', Date\Date::ISO_8601);
  1972. $this->assertTrue($edate->equals($feed->getDateModified()));
  1973. }
  1974. public function testGetsDateModifiedFromRss093_Dc11()
  1975. {
  1976. $feed = Reader\Reader::importString(
  1977. file_get_contents($this->_feedSamplePath.'/datemodified/plain/dc11/rss093.xml')
  1978. );
  1979. $edate = new Date\Date;
  1980. $edate->set('2009-03-07T08:03:50Z', Date\Date::ISO_8601);
  1981. $this->assertTrue($edate->equals($feed->getDateModified()));
  1982. }
  1983. public function testGetsDateModifiedFromRss092_Dc11()
  1984. {
  1985. $feed = Reader\Reader::importString(
  1986. file_get_contents($this->_feedSamplePath.'/datemodified/plain/dc11/rss092.xml')
  1987. );
  1988. $edate = new Date\Date;
  1989. $edate->set('2009-03-07T08:03:50Z', Date\Date::ISO_8601);
  1990. $this->assertTrue($edate->equals($feed->getDateModified()));
  1991. }
  1992. public function testGetsDateModifiedFromRss091_Dc11()
  1993. {
  1994. $feed = Reader\Reader::importString(
  1995. file_get_contents($this->_feedSamplePath.'/datemodified/plain/dc11/rss091.xml')
  1996. );
  1997. $edate = new Date\Date;
  1998. $edate->set('2009-03-07T08:03:50Z', Date\Date::ISO_8601);
  1999. $this->assertTrue($edate->equals($feed->getDateModified()));
  2000. }
  2001. public function testGetsDateModifiedFromRss10_Dc11()
  2002. {
  2003. $feed = Reader\Reader::importString(
  2004. file_get_contents($this->_feedSamplePath.'/datemodified/plain/dc11/rss10.xml')
  2005. );
  2006. $edate = new Date\Date;
  2007. $edate->set('2009-03-07T08:03:50Z', Date\Date::ISO_8601);
  2008. $this->assertTrue($edate->equals($feed->getDateModified()));
  2009. }
  2010. public function testGetsDateModifiedFromRss090_Dc11()
  2011. {
  2012. $feed = Reader\Reader::importString(
  2013. file_get_contents($this->_feedSamplePath.'/datemodified/plain/dc11/rss090.xml')
  2014. );
  2015. $edate = new Date\Date;
  2016. $edate->set('2009-03-07T08:03:50Z', Date\Date::ISO_8601);
  2017. $this->assertTrue($edate->equals($feed->getDateModified()));
  2018. }
  2019. // Atom 1.0
  2020. public function testGetsDateModifiedFromRss20_atom10()
  2021. {
  2022. $feed = Reader\Reader::importString(
  2023. file_get_contents($this->_feedSamplePath.'/datemodified/plain/atom10/rss20.xml')
  2024. );
  2025. $edate = new Date\Date;
  2026. $edate->set('2009-03-07T08:03:50Z', Date\Date::ISO_8601);
  2027. $this->assertTrue($edate->equals($feed->getDateModified()));
  2028. }
  2029. public function testGetsDateModifiedFromRss094_atom10()
  2030. {
  2031. $feed = Reader\Reader::importString(
  2032. file_get_contents($this->_feedSamplePath.'/datemodified/plain/atom10/rss094.xml')
  2033. );
  2034. $edate = new Date\Date;
  2035. $edate->set('2009-03-07T08:03:50Z', Date\Date::ISO_8601);
  2036. $this->assertTrue($edate->equals($feed->getDateModified()));
  2037. }
  2038. public function testGetsDateModifiedFromRss093_atom10()
  2039. {
  2040. $feed = Reader\Reader::importString(
  2041. file_get_contents($this->_feedSamplePath.'/datemodified/plain/atom10/rss093.xml')
  2042. );
  2043. $edate = new Date\Date;
  2044. $edate->set('2009-03-07T08:03:50Z', Date\Date::ISO_8601);
  2045. $this->assertTrue($edate->equals($feed->getDateModified()));
  2046. }
  2047. public function testGetsDateModifiedFromRss092_atom10()
  2048. {
  2049. $feed = Reader\Reader::importString(
  2050. file_get_contents($this->_feedSamplePath.'/datemodified/plain/atom10/rss092.xml')
  2051. );
  2052. $edate = new Date\Date;
  2053. $edate->set('2009-03-07T08:03:50Z', Date\Date::ISO_8601);
  2054. $this->assertTrue($edate->equals($feed->getDateModified()));
  2055. }
  2056. public function testGetsDateModifiedFromRss091_atom10()
  2057. {
  2058. $feed = Reader\Reader::importString(
  2059. file_get_contents($this->_feedSamplePath.'/datemodified/plain/atom10/rss091.xml')
  2060. );
  2061. $edate = new Date\Date;
  2062. $edate->set('2009-03-07T08:03:50Z', Date\Date::ISO_8601);
  2063. $this->assertTrue($edate->equals($feed->getDateModified()));
  2064. }
  2065. public function testGetsDateModifiedFromRss10_atom10()
  2066. {
  2067. $feed = Reader\Reader::importString(
  2068. file_get_contents($this->_feedSamplePath.'/datemodified/plain/atom10/rss10.xml')
  2069. );
  2070. $edate = new Date\Date;
  2071. $edate->set('2009-03-07T08:03:50Z', Date\Date::ISO_8601);
  2072. $this->assertTrue($edate->equals($feed->getDateModified()));
  2073. }
  2074. public function testGetsDateModifiedFromRss090_atom10()
  2075. {
  2076. $feed = Reader\Reader::importString(
  2077. file_get_contents($this->_feedSamplePath.'/datemodified/plain/atom10/rss090.xml')
  2078. );
  2079. $edate = new Date\Date;
  2080. $edate->set('2009-03-07T08:03:50Z', Date\Date::ISO_8601);
  2081. $this->assertTrue($edate->equals($feed->getDateModified()));
  2082. }
  2083. // Missing DateModified
  2084. public function testGetsDateModifiedFromRss20_None()
  2085. {
  2086. $feed = Reader\Reader::importString(
  2087. file_get_contents($this->_feedSamplePath.'/datemodified/plain/none/rss20.xml')
  2088. );
  2089. $this->assertEquals(null, $feed->getDateModified());
  2090. }
  2091. public function testGetsDateModifiedFromRss094_None()
  2092. {
  2093. $feed = Reader\Reader::importString(
  2094. file_get_contents($this->_feedSamplePath.'/datemodified/plain/none/rss094.xml')
  2095. );
  2096. $this->assertEquals(null, $feed->getDateModified());
  2097. }
  2098. public function testGetsDateModifiedFromRss093_None()
  2099. {
  2100. $feed = Reader\Reader::importString(
  2101. file_get_contents($this->_feedSamplePath.'/datemodified/plain/none/rss093.xml')
  2102. );
  2103. $this->assertEquals(null, $feed->getDateModified());
  2104. }
  2105. public function testGetsDateModifiedFromRss092_None()
  2106. {
  2107. $feed = Reader\Reader::importString(
  2108. file_get_contents($this->_feedSamplePath.'/datemodified/plain/none/rss092.xml')
  2109. );
  2110. $this->assertEquals(null, $feed->getDateModified());
  2111. }
  2112. public function testGetsDateModifiedFromRss091_None()
  2113. {
  2114. $feed = Reader\Reader::importString(
  2115. file_get_contents($this->_feedSamplePath.'/datemodified/plain/none/rss091.xml')
  2116. );
  2117. $this->assertEquals(null, $feed->getDateModified());
  2118. }
  2119. public function testGetsDateModifiedFromRss10_None()
  2120. {
  2121. $feed = Reader\Reader::importString(
  2122. file_get_contents($this->_feedSamplePath.'/datemodified/plain/none/rss10.xml')
  2123. );
  2124. $this->assertEquals(null, $feed->getDateModified());
  2125. }
  2126. public function testGetsDateModifiedFromRss090_None()
  2127. {
  2128. $feed = Reader\Reader::importString(
  2129. file_get_contents($this->_feedSamplePath.'/datemodified/plain/none/rss090.xml')
  2130. );
  2131. $this->assertEquals(null, $feed->getDateModified());
  2132. }
  2133. /**
  2134. * Get Hubs (Unencoded Text)
  2135. */
  2136. public function testGetsHubsFromRss20()
  2137. {
  2138. $feed = Reader\Reader::importString(
  2139. file_get_contents($this->_feedSamplePath.'/hubs/plain/atom10/rss20.xml')
  2140. );
  2141. $this->assertEquals(array(
  2142. 'http://www.example.com/hub1',
  2143. 'http://www.example.com/hub2'
  2144. ), $feed->getHubs());
  2145. }
  2146. public function testGetsHubsFromRss094()
  2147. {
  2148. $feed = Reader\Reader::importString(
  2149. file_get_contents($this->_feedSamplePath.'/hubs/plain/atom10/rss094.xml')
  2150. );
  2151. $this->assertEquals(array(
  2152. 'http://www.example.com/hub1',
  2153. 'http://www.example.com/hub2'
  2154. ), $feed->getHubs());
  2155. }
  2156. public function testGetsHubsFromRss093()
  2157. {
  2158. $feed = Reader\Reader::importString(
  2159. file_get_contents($this->_feedSamplePath.'/hubs/plain/atom10/rss093.xml')
  2160. );
  2161. $this->assertEquals(array(
  2162. 'http://www.example.com/hub1',
  2163. 'http://www.example.com/hub2'
  2164. ), $feed->getHubs());
  2165. }
  2166. public function testGetsHubsFromRss092()
  2167. {
  2168. $feed = Reader\Reader::importString(
  2169. file_get_contents($this->_feedSamplePath.'/hubs/plain/atom10/rss092.xml')
  2170. );
  2171. $this->assertEquals(array(
  2172. 'http://www.example.com/hub1',
  2173. 'http://www.example.com/hub2'
  2174. ), $feed->getHubs());
  2175. }
  2176. public function testGetsHubsFromRss091()
  2177. {
  2178. $feed = Reader\Reader::importString(
  2179. file_get_contents($this->_feedSamplePath.'/hubs/plain/atom10/rss091.xml')
  2180. );
  2181. $this->assertEquals(array(
  2182. 'http://www.example.com/hub1',
  2183. 'http://www.example.com/hub2'
  2184. ), $feed->getHubs());
  2185. }
  2186. public function testGetsHubsFromRss10()
  2187. {
  2188. $feed = Reader\Reader::importString(
  2189. file_get_contents($this->_feedSamplePath.'/hubs/plain/atom10/rss10.xml')
  2190. );
  2191. $this->assertEquals(array(
  2192. 'http://www.example.com/hub1',
  2193. 'http://www.example.com/hub2'
  2194. ), $feed->getHubs());
  2195. }
  2196. public function testGetsHubsFromRss090()
  2197. {
  2198. $feed = Reader\Reader::importString(
  2199. file_get_contents($this->_feedSamplePath.'/hubs/plain/atom10/rss090.xml')
  2200. );
  2201. $this->assertEquals(array(
  2202. 'http://www.example.com/hub1',
  2203. 'http://www.example.com/hub2'
  2204. ), $feed->getHubs());
  2205. }
  2206. // Missing Hubs
  2207. public function testGetsHubsFromRss20_None()
  2208. {
  2209. $feed = Reader\Reader::importString(
  2210. file_get_contents($this->_feedSamplePath.'/hubs/plain/none/rss20.xml')
  2211. );
  2212. $this->assertEquals(null, $feed->getHubs());
  2213. }
  2214. public function testGetsHubsFromRss094_None()
  2215. {
  2216. $feed = Reader\Reader::importString(
  2217. file_get_contents($this->_feedSamplePath.'/hubs/plain/none/rss094.xml')
  2218. );
  2219. $this->assertEquals(null, $feed->getHubs());
  2220. }
  2221. public function testGetsHubsFromRss093_None()
  2222. {
  2223. $feed = Reader\Reader::importString(
  2224. file_get_contents($this->_feedSamplePath.'/hubs/plain/none/rss093.xml')
  2225. );
  2226. $this->assertEquals(null, $feed->getHubs());
  2227. }
  2228. public function testGetsHubsFromRss092_None()
  2229. {
  2230. $feed = Reader\Reader::importString(
  2231. file_get_contents($this->_feedSamplePath.'/hubs/plain/none/rss092.xml')
  2232. );
  2233. $this->assertEquals(null, $feed->getHubs());
  2234. }
  2235. public function testGetsHubsFromRss091_None()
  2236. {
  2237. $feed = Reader\Reader::importString(
  2238. file_get_contents($this->_feedSamplePath.'/hubs/plain/none/rss091.xml')
  2239. );
  2240. $this->assertEquals(null, $feed->getHubs());
  2241. }
  2242. public function testGetsHubsFromRss10_None()
  2243. {
  2244. $feed = Reader\Reader::importString(
  2245. file_get_contents($this->_feedSamplePath.'/hubs/plain/none/rss10.xml')
  2246. );
  2247. $this->assertEquals(null, $feed->getHubs());
  2248. }
  2249. public function testGetsHubsFromRss090_None()
  2250. {
  2251. $feed = Reader\Reader::importString(
  2252. file_get_contents($this->_feedSamplePath.'/hubs/plain/none/rss090.xml')
  2253. );
  2254. $this->assertEquals(null, $feed->getHubs());
  2255. }
  2256. /**
  2257. * Get category data
  2258. */
  2259. // RSS 2.0
  2260. public function testGetsCategoriesFromRss20()
  2261. {
  2262. $feed = Reader\Reader::importString(
  2263. file_get_contents($this->_feedSamplePath.'/category/plain/rss20.xml')
  2264. );
  2265. $this->assertEquals($this->_expectedCats, (array) $feed->getCategories());
  2266. $this->assertEquals(array('topic1','topic2'), array_values($feed->getCategories()->getValues()));
  2267. }
  2268. // DC 1.0
  2269. public function testGetsCategoriesFromRss090_Dc10()
  2270. {
  2271. $feed = Reader\Reader::importString(
  2272. file_get_contents($this->_feedSamplePath.'/category/plain/dc10/rss090.xml')
  2273. );
  2274. $this->assertEquals($this->_expectedCatsRdf, (array) $feed->getCategories());
  2275. $this->assertEquals(array('topic1','topic2'), array_values($feed->getCategories()->getValues()));
  2276. }
  2277. public function testGetsCategoriesFromRss091_Dc10()
  2278. {
  2279. $feed = Reader\Reader::importString(
  2280. file_get_contents($this->_feedSamplePath.'/category/plain/dc10/rss091.xml')
  2281. );
  2282. $this->assertEquals($this->_expectedCatsRdf, (array) $feed->getCategories());
  2283. $this->assertEquals(array('topic1','topic2'), array_values($feed->getCategories()->getValues()));
  2284. }
  2285. public function testGetsCategoriesFromRss092_Dc10()
  2286. {
  2287. $feed = Reader\Reader::importString(
  2288. file_get_contents($this->_feedSamplePath.'/category/plain/dc10/rss092.xml')
  2289. );
  2290. $this->assertEquals($this->_expectedCatsRdf, (array) $feed->getCategories());
  2291. $this->assertEquals(array('topic1','topic2'), array_values($feed->getCategories()->getValues()));
  2292. }
  2293. public function testGetsCategoriesFromRss093_Dc10()
  2294. {
  2295. $feed = Reader\Reader::importString(
  2296. file_get_contents($this->_feedSamplePath.'/category/plain/dc10/rss093.xml')
  2297. );
  2298. $this->assertEquals($this->_expectedCatsRdf, (array) $feed->getCategories());
  2299. $this->assertEquals(array('topic1','topic2'), array_values($feed->getCategories()->getValues()));
  2300. }
  2301. public function testGetsCategoriesFromRss094_Dc10()
  2302. {
  2303. $feed = Reader\Reader::importString(
  2304. file_get_contents($this->_feedSamplePath.'/category/plain/dc10/rss094.xml')
  2305. );
  2306. $this->assertEquals($this->_expectedCatsRdf, (array) $feed->getCategories());
  2307. $this->assertEquals(array('topic1','topic2'), array_values($feed->getCategories()->getValues()));
  2308. }
  2309. public function testGetsCategoriesFromRss10_Dc10()
  2310. {
  2311. $feed = Reader\Reader::importString(
  2312. file_get_contents($this->_feedSamplePath.'/category/plain/dc10/rss10.xml')
  2313. );
  2314. $this->assertEquals($this->_expectedCatsRdf, (array) $feed->getCategories());
  2315. $this->assertEquals(array('topic1','topic2'), array_values($feed->getCategories()->getValues()));
  2316. }
  2317. // DC 1.1
  2318. public function testGetsCategoriesFromRss090_Dc11()
  2319. {
  2320. $feed = Reader\Reader::importString(
  2321. file_get_contents($this->_feedSamplePath.'/category/plain/dc11/rss090.xml')
  2322. );
  2323. $this->assertEquals($this->_expectedCatsRdf, (array) $feed->getCategories());
  2324. $this->assertEquals(array('topic1','topic2'), array_values($feed->getCategories()->getValues()));
  2325. }
  2326. public function testGetsCategoriesFromRss091_Dc11()
  2327. {
  2328. $feed = Reader\Reader::importString(
  2329. file_get_contents($this->_feedSamplePath.'/category/plain/dc11/rss091.xml')
  2330. );
  2331. $this->assertEquals($this->_expectedCatsRdf, (array) $feed->getCategories());
  2332. $this->assertEquals(array('topic1','topic2'), array_values($feed->getCategories()->getValues()));
  2333. }
  2334. public function testGetsCategoriesFromRss092_Dc11()
  2335. {
  2336. $feed = Reader\Reader::importString(
  2337. file_get_contents($this->_feedSamplePath.'/category/plain/dc11/rss092.xml')
  2338. );
  2339. $this->assertEquals($this->_expectedCatsRdf, (array) $feed->getCategories());
  2340. $this->assertEquals(array('topic1','topic2'), array_values($feed->getCategories()->getValues()));
  2341. }
  2342. public function testGetsCategoriesFromRss093_Dc11()
  2343. {
  2344. $feed = Reader\Reader::importString(
  2345. file_get_contents($this->_feedSamplePath.'/category/plain/dc11/rss093.xml')
  2346. );
  2347. $this->assertEquals($this->_expectedCatsRdf, (array) $feed->getCategories());
  2348. $this->assertEquals(array('topic1','topic2'), array_values($feed->getCategories()->getValues()));
  2349. }
  2350. public function testGetsCategoriesFromRss094_Dc11()
  2351. {
  2352. $feed = Reader\Reader::importString(
  2353. file_get_contents($this->_feedSamplePath.'/category/plain/dc11/rss094.xml')
  2354. );
  2355. $this->assertEquals($this->_expectedCatsRdf, (array) $feed->getCategories());
  2356. $this->assertEquals(array('topic1','topic2'), array_values($feed->getCategories()->getValues()));
  2357. }
  2358. public function testGetsCategoriesFromRss10_Dc11()
  2359. {
  2360. $feed = Reader\Reader::importString(
  2361. file_get_contents($this->_feedSamplePath.'/category/plain/dc11/rss10.xml')
  2362. );
  2363. $this->assertEquals($this->_expectedCatsRdf, (array) $feed->getCategories());
  2364. $this->assertEquals(array('topic1','topic2'), array_values($feed->getCategories()->getValues()));
  2365. }
  2366. // Atom 1.0
  2367. public function testGetsCategoriesFromRss090_Atom10()
  2368. {
  2369. $feed = Reader\Reader::importString(
  2370. file_get_contents($this->_feedSamplePath.'/category/plain/atom10/rss090.xml')
  2371. );
  2372. $this->assertEquals($this->_expectedCatsAtom, (array) $feed->getCategories());
  2373. $this->assertEquals(array('topic1','Cat & Dog'), array_values($feed->getCategories()->getValues()));
  2374. }
  2375. public function testGetsCategoriesFromRss091_Atom10()
  2376. {
  2377. $feed = Reader\Reader::importString(
  2378. file_get_contents($this->_feedSamplePath.'/category/plain/atom10/rss091.xml')
  2379. );
  2380. $this->assertEquals($this->_expectedCatsAtom, (array) $feed->getCategories());
  2381. $this->assertEquals(array('topic1','Cat & Dog'), array_values($feed->getCategories()->getValues()));
  2382. }
  2383. public function testGetsCategoriesFromRss092_Atom10()
  2384. {
  2385. $feed = Reader\Reader::importString(
  2386. file_get_contents($this->_feedSamplePath.'/category/plain/atom10/rss092.xml')
  2387. );
  2388. $this->assertEquals($this->_expectedCatsAtom, (array) $feed->getCategories());
  2389. $this->assertEquals(array('topic1','Cat & Dog'), array_values($feed->getCategories()->getValues()));
  2390. }
  2391. public function testGetsCategoriesFromRss093_Atom10()
  2392. {
  2393. $feed = Reader\Reader::importString(
  2394. file_get_contents($this->_feedSamplePath.'/category/plain/atom10/rss093.xml')
  2395. );
  2396. $this->assertEquals($this->_expectedCatsAtom, (array) $feed->getCategories());
  2397. $this->assertEquals(array('topic1','Cat & Dog'), array_values($feed->getCategories()->getValues()));
  2398. }
  2399. public function testGetsCategoriesFromRss094_Atom10()
  2400. {
  2401. $feed = Reader\Reader::importString(
  2402. file_get_contents($this->_feedSamplePath.'/category/plain/atom10/rss094.xml')
  2403. );
  2404. $this->assertEquals($this->_expectedCatsAtom, (array) $feed->getCategories());
  2405. $this->assertEquals(array('topic1','Cat & Dog'), array_values($feed->getCategories()->getValues()));
  2406. }
  2407. public function testGetsCategoriesFromRss10_Atom10()
  2408. {
  2409. $feed = Reader\Reader::importString(
  2410. file_get_contents($this->_feedSamplePath.'/category/plain/atom10/rss10.xml')
  2411. );
  2412. $this->assertEquals($this->_expectedCatsAtom, (array) $feed->getCategories());
  2413. $this->assertEquals(array('topic1','Cat & Dog'), array_values($feed->getCategories()->getValues()));
  2414. }
  2415. // No Categories In Entry
  2416. public function testGetsCategoriesFromRss20_None()
  2417. {
  2418. $feed = Reader\Reader::importString(
  2419. file_get_contents($this->_feedSamplePath.'/category/plain/none/rss20.xml')
  2420. );
  2421. $this->assertEquals(array(), (array) $feed->getCategories());
  2422. $this->assertEquals(array(), array_values($feed->getCategories()->getValues()));
  2423. }
  2424. public function testGetsCategoriesFromRss090_None()
  2425. {
  2426. $feed = Reader\Reader::importString(
  2427. file_get_contents($this->_feedSamplePath.'/category/plain/none/rss090.xml')
  2428. );
  2429. $this->assertEquals(array(), (array) $feed->getCategories());
  2430. $this->assertEquals(array(), array_values($feed->getCategories()->getValues()));
  2431. }
  2432. public function testGetsCategoriesFromRss091_None()
  2433. {
  2434. $feed = Reader\Reader::importString(
  2435. file_get_contents($this->_feedSamplePath.'/category/plain/none/rss091.xml')
  2436. );
  2437. $this->assertEquals(array(), (array) $feed->getCategories());
  2438. $this->assertEquals(array(), array_values($feed->getCategories()->getValues()));
  2439. }
  2440. public function testGetsCategoriesFromRss092_None()
  2441. {
  2442. $feed = Reader\Reader::importString(
  2443. file_get_contents($this->_feedSamplePath.'/category/plain/none/rss092.xml')
  2444. );
  2445. $this->assertEquals(array(), (array) $feed->getCategories());
  2446. $this->assertEquals(array(), array_values($feed->getCategories()->getValues()));
  2447. }
  2448. public function testGetsCategoriesFromRss093_None()
  2449. {
  2450. $feed = Reader\Reader::importString(
  2451. file_get_contents($this->_feedSamplePath.'/category/plain/none/rss093.xml')
  2452. );
  2453. $this->assertEquals(array(), (array) $feed->getCategories());
  2454. $this->assertEquals(array(), array_values($feed->getCategories()->getValues()));
  2455. }
  2456. public function testGetsCategoriesFromRss094_None()
  2457. {
  2458. $feed = Reader\Reader::importString(
  2459. file_get_contents($this->_feedSamplePath.'/category/plain/none/rss094.xml')
  2460. );
  2461. $this->assertEquals(array(), (array) $feed->getCategories());
  2462. $this->assertEquals(array(), array_values($feed->getCategories()->getValues()));
  2463. }
  2464. public function testGetsCategoriesFromRss10_None()
  2465. {
  2466. $feed = Reader\Reader::importString(
  2467. file_get_contents($this->_feedSamplePath.'/category/plain/none/rss10.xml')
  2468. );
  2469. $this->assertEquals(array(), (array) $feed->getCategories());
  2470. $this->assertEquals(array(), array_values($feed->getCategories()->getValues()));
  2471. }
  2472. /**
  2473. * Get Image data (Unencoded Text)
  2474. */
  2475. public function testGetsImageFromRss20()
  2476. {
  2477. $feed = Reader\Reader::importString(
  2478. file_get_contents($this->_feedSamplePath.'/image/plain/rss20.xml')
  2479. );
  2480. $this->assertEquals(array(
  2481. 'uri' => 'http://www.example.com/image.gif',
  2482. 'link' => 'http://www.example.com',
  2483. 'title' => 'Image title',
  2484. 'height' => '55',
  2485. 'width' => '50',
  2486. 'description' => 'Image description'
  2487. ), $feed->getImage());
  2488. }
  2489. public function testGetsImageFromRss094()
  2490. {
  2491. $feed = Reader\Reader::importString(
  2492. file_get_contents($this->_feedSamplePath.'/image/plain/rss094.xml')
  2493. );
  2494. $this->assertEquals(array(
  2495. 'uri' => 'http://www.example.com/image.gif',
  2496. 'link' => 'http://www.example.com',
  2497. 'title' => 'Image title',
  2498. 'height' => '55',
  2499. 'width' => '50',
  2500. 'description' => 'Image description'
  2501. ), $feed->getImage());
  2502. }
  2503. public function testGetsImageFromRss093()
  2504. {
  2505. $feed = Reader\Reader::importString(
  2506. file_get_contents($this->_feedSamplePath.'/image/plain/rss093.xml')
  2507. );
  2508. $this->assertEquals(array(
  2509. 'uri' => 'http://www.example.com/image.gif',
  2510. 'link' => 'http://www.example.com',
  2511. 'title' => 'Image title',
  2512. 'height' => '55',
  2513. 'width' => '50',
  2514. 'description' => 'Image description'
  2515. ), $feed->getImage());
  2516. }
  2517. public function testGetsImageFromRss092()
  2518. {
  2519. $feed = Reader\Reader::importString(
  2520. file_get_contents($this->_feedSamplePath.'/image/plain/rss092.xml')
  2521. );
  2522. $this->assertEquals(array(
  2523. 'uri' => 'http://www.example.com/image.gif',
  2524. 'link' => 'http://www.example.com',
  2525. 'title' => 'Image title',
  2526. 'height' => '55',
  2527. 'width' => '50',
  2528. 'description' => 'Image description'
  2529. ), $feed->getImage());
  2530. }
  2531. public function testGetsImageFromRss091()
  2532. {
  2533. $feed = Reader\Reader::importString(
  2534. file_get_contents($this->_feedSamplePath.'/image/plain/rss091.xml')
  2535. );
  2536. $this->assertEquals(array(
  2537. 'uri' => 'http://www.example.com/image.gif',
  2538. 'link' => 'http://www.example.com',
  2539. 'title' => 'Image title',
  2540. 'height' => '55',
  2541. 'width' => '50',
  2542. 'description' => 'Image description'
  2543. ), $feed->getImage());
  2544. }
  2545. /*public function testGetsImageFromRss10()
  2546. {
  2547. $feed = Reader\Reader::importString(
  2548. file_get_contents($this->_feedSamplePath.'/image/plain/rss10.xml')
  2549. );
  2550. $this->assertEquals(array(
  2551. 'uri' => 'http://www.example.com/image.gif',
  2552. 'link' => 'http://www.example.com',
  2553. 'title' => 'Image title',
  2554. 'height' => '55',
  2555. 'width' => '50',
  2556. 'description' => 'Image description'
  2557. ), $feed->getImage());
  2558. }
  2559. public function testGetsImageFromRss090()
  2560. {
  2561. $feed = Reader\Reader::importString(
  2562. file_get_contents($this->_feedSamplePath.'/image/plain/rss090.xml')
  2563. );
  2564. $this->assertEquals(array(
  2565. 'uri' => 'http://www.example.com/image.gif',
  2566. 'link' => 'http://www.example.com',
  2567. 'title' => 'Image title',
  2568. 'height' => '55',
  2569. 'width' => '50',
  2570. 'description' => 'Image description'
  2571. ), $feed->getImage());
  2572. }*/
  2573. /**
  2574. * Get Image data (Unencoded Text) Missing
  2575. */
  2576. public function testGetsImageFromRss20_None()
  2577. {
  2578. $feed = Reader\Reader::importString(
  2579. file_get_contents($this->_feedSamplePath.'/image/plain/none/rss20.xml')
  2580. );
  2581. $this->assertEquals(null, $feed->getImage());
  2582. }
  2583. public function testGetsImageFromRss094_None()
  2584. {
  2585. $feed = Reader\Reader::importString(
  2586. file_get_contents($this->_feedSamplePath.'/image/plain/none/rss094.xml')
  2587. );
  2588. $this->assertEquals(null, $feed->getImage());
  2589. }
  2590. public function testGetsImageFromRss093_None()
  2591. {
  2592. $feed = Reader\Reader::importString(
  2593. file_get_contents($this->_feedSamplePath.'/image/plain/none/rss093.xml')
  2594. );
  2595. $this->assertEquals(null, $feed->getImage());
  2596. }
  2597. public function testGetsImageFromRss092_None()
  2598. {
  2599. $feed = Reader\Reader::importString(
  2600. file_get_contents($this->_feedSamplePath.'/image/plain/none/rss092.xml')
  2601. );
  2602. $this->assertEquals(null, $feed->getImage());
  2603. }
  2604. public function testGetsImageFromRss091_None()
  2605. {
  2606. $feed = Reader\Reader::importString(
  2607. file_get_contents($this->_feedSamplePath.'/image/plain/none/rss091.xml')
  2608. );
  2609. $this->assertEquals(null, $feed->getImage());
  2610. }
  2611. public function testGetsImageFromRss10_None()
  2612. {
  2613. $feed = Reader\Reader::importString(
  2614. file_get_contents($this->_feedSamplePath.'/image/plain/none/rss10.xml')
  2615. );
  2616. $this->assertEquals(null, $feed->getImage());
  2617. }
  2618. public function testGetsImageFromRss090_None()
  2619. {
  2620. $feed = Reader\Reader::importString(
  2621. file_get_contents($this->_feedSamplePath.'/image/plain/none/rss090.xml')
  2622. );
  2623. $this->assertEquals(null, $feed->getImage());
  2624. }
  2625. }