RssHelperTest.php 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754
  1. <?php
  2. /**
  3. * RssHelperTest file
  4. *
  5. * CakePHP(tm) Tests <http://book.cakephp.org/2.0/en/development/testing.html>
  6. * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
  7. *
  8. * Licensed under The MIT License
  9. * For full copyright and license information, please see the LICENSE.txt
  10. * Redistributions of files must retain the above copyright notice
  11. *
  12. * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
  13. * @link http://book.cakephp.org/2.0/en/development/testing.html CakePHP(tm) Tests
  14. * @since 1.2.0
  15. * @license http://www.opensource.org/licenses/mit-license.php MIT License
  16. */
  17. namespace Cake\Test\TestCase\View\Helper;
  18. use Cake\TestSuite\TestCase;
  19. use Cake\Utility\File;
  20. use Cake\Utility\Folder;
  21. use Cake\View\Helper\RssHelper;
  22. use Cake\View\Helper\TimeHelper;
  23. use Cake\View\View;
  24. /**
  25. * RssHelperTest class
  26. *
  27. */
  28. class RssHelperTest extends TestCase {
  29. /**
  30. * setUp method
  31. *
  32. * @return void
  33. */
  34. public function setUp() {
  35. parent::setUp();
  36. $controller = null;
  37. $this->View = new View($controller);
  38. $this->Rss = new RssHelper($this->View);
  39. }
  40. /**
  41. * tearDown method
  42. *
  43. * @return void
  44. */
  45. public function tearDown() {
  46. parent::tearDown();
  47. unset($this->Rss);
  48. }
  49. /**
  50. * testDocument method
  51. *
  52. * @return void
  53. */
  54. public function testDocument() {
  55. $result = $this->Rss->document();
  56. $expected = array(
  57. 'rss' => array(
  58. 'version' => '2.0'
  59. )
  60. );
  61. $this->assertTags($result, $expected);
  62. $result = $this->Rss->document(null, 'content');
  63. $expected = array(
  64. 'rss' => array(
  65. 'version' => '2.0'
  66. ),
  67. 'content'
  68. );
  69. $this->assertTags($result, $expected);
  70. $result = $this->Rss->document(array('contrived' => 'parameter'), 'content');
  71. $expected = array(
  72. 'rss' => array(
  73. 'contrived' => 'parameter',
  74. 'version' => '2.0'
  75. ),
  76. 'content'
  77. );
  78. $this->assertTags($result, $expected);
  79. }
  80. /**
  81. * testChannel method
  82. *
  83. * @return void
  84. */
  85. public function testChannel() {
  86. $attrib = array('a' => '1', 'b' => '2');
  87. $elements = array('title' => 'Title');
  88. $content = 'content';
  89. $result = $this->Rss->channel($attrib, $elements, $content);
  90. $expected = array(
  91. 'channel' => array(
  92. 'a' => '1',
  93. 'b' => '2'
  94. ),
  95. '<title',
  96. 'Title',
  97. '/title',
  98. '<link',
  99. $this->Rss->url('/', true),
  100. '/link',
  101. '<description',
  102. 'content',
  103. '/channel'
  104. );
  105. $this->assertTags($result, $expected);
  106. }
  107. /**
  108. * test correct creation of channel sub elements.
  109. *
  110. * @return void
  111. */
  112. public function testChannelElements() {
  113. $attrib = array();
  114. $elements = array(
  115. 'title' => 'Title of RSS Feed',
  116. 'link' => 'http://example.com',
  117. 'description' => 'Description of RSS Feed',
  118. 'image' => array(
  119. 'title' => 'Title of image',
  120. 'url' => 'http://example.com/example.png',
  121. 'link' => 'http://example.com'
  122. ),
  123. 'cloud' => array(
  124. 'domain' => "rpc.sys.com",
  125. 'port' => "80",
  126. 'path' => "/RPC2",
  127. 'registerProcedure' => "myCloud.rssPleaseNotify",
  128. 'protocol' => "xml-rpc"
  129. )
  130. );
  131. $content = 'content-here';
  132. $result = $this->Rss->channel($attrib, $elements, $content);
  133. $expected = array(
  134. '<channel',
  135. '<title', 'Title of RSS Feed', '/title',
  136. '<link', 'http://example.com', '/link',
  137. '<description', 'Description of RSS Feed', '/description',
  138. '<image',
  139. '<title', 'Title of image', '/title',
  140. '<url', 'http://example.com/example.png', '/url',
  141. '<link', 'http://example.com', '/link',
  142. '/image',
  143. 'cloud' => array(
  144. 'domain' => "rpc.sys.com",
  145. 'port' => "80",
  146. 'path' => "/RPC2",
  147. 'registerProcedure' => "myCloud.rssPleaseNotify",
  148. 'protocol' => "xml-rpc"
  149. ),
  150. 'content-here',
  151. '/channel',
  152. );
  153. $this->assertTags($result, $expected);
  154. }
  155. public function testChannelElementAttributes() {
  156. $attrib = array();
  157. $elements = array(
  158. 'title' => 'Title of RSS Feed',
  159. 'link' => 'http://example.com',
  160. 'description' => 'Description of RSS Feed',
  161. 'image' => array(
  162. 'title' => 'Title of image',
  163. 'url' => 'http://example.com/example.png',
  164. 'link' => 'http://example.com'
  165. ),
  166. 'atom:link' => array(
  167. 'attrib' => array(
  168. 'href' => 'http://www.example.com/rss.xml',
  169. 'rel' => 'self',
  170. 'type' => 'application/rss+xml')
  171. )
  172. );
  173. $content = 'content-here';
  174. $result = $this->Rss->channel($attrib, $elements, $content);
  175. $expected = array(
  176. '<channel',
  177. '<title', 'Title of RSS Feed', '/title',
  178. '<link', 'http://example.com', '/link',
  179. '<description', 'Description of RSS Feed', '/description',
  180. '<image',
  181. '<title', 'Title of image', '/title',
  182. '<url', 'http://example.com/example.png', '/url',
  183. '<link', 'http://example.com', '/link',
  184. '/image',
  185. 'atom:link' => array(
  186. 'xmlns:atom' => 'http://www.w3.org/2005/Atom',
  187. 'href' => "http://www.example.com/rss.xml",
  188. 'rel' => "self",
  189. 'type' => "application/rss+xml"
  190. ),
  191. 'content-here',
  192. '/channel',
  193. );
  194. $this->assertTags($result, $expected);
  195. }
  196. /**
  197. * testItems method
  198. *
  199. * @return void
  200. */
  201. public function testItems() {
  202. $items = array(
  203. array('title' => 'title1', 'guid' => 'http://www.example.com/guid1', 'link' => 'http://www.example.com/link1', 'description' => 'description1'),
  204. array('title' => 'title2', 'guid' => 'http://www.example.com/guid2', 'link' => 'http://www.example.com/link2', 'description' => 'description2'),
  205. array('title' => 'title3', 'guid' => 'http://www.example.com/guid3', 'link' => 'http://www.example.com/link3', 'description' => 'description3')
  206. );
  207. $result = $this->Rss->items($items);
  208. $expected = array(
  209. '<item',
  210. '<title', 'title1', '/title',
  211. '<guid', 'http://www.example.com/guid1', '/guid',
  212. '<link', 'http://www.example.com/link1', '/link',
  213. '<description', 'description1', '/description',
  214. '/item',
  215. '<item',
  216. '<title', 'title2', '/title',
  217. '<guid', 'http://www.example.com/guid2', '/guid',
  218. '<link', 'http://www.example.com/link2', '/link',
  219. '<description', 'description2', '/description',
  220. '/item',
  221. '<item',
  222. '<title', 'title3', '/title',
  223. '<guid', 'http://www.example.com/guid3', '/guid',
  224. '<link', 'http://www.example.com/link3', '/link',
  225. '<description', 'description3', '/description',
  226. '/item'
  227. );
  228. $this->assertTags($result, $expected);
  229. $items = array(
  230. array('title' => 'title1', 'guid' => 'http://www.example.com/guid1', 'link' => 'http://www.example.com/link1', 'description' => 'description1'),
  231. array('title' => 'title2', 'guid' => 'http://www.example.com/guid2', 'link' => 'http://www.example.com/link2', 'description' => 'description2'),
  232. array('title' => 'title3', 'guid' => 'http://www.example.com/guid3', 'link' => 'http://www.example.com/link3', 'description' => 'description3')
  233. );
  234. $result = $this->Rss->items($items, create_function('$v', '$v[\'title\'] = $v[\'title\'] . \'-transformed\'; return $v;'));
  235. $expected = array(
  236. '<item',
  237. '<title', 'title1-transformed', '/title',
  238. '<guid', 'http://www.example.com/guid1', '/guid',
  239. '<link', 'http://www.example.com/link1', '/link',
  240. '<description', 'description1', '/description',
  241. '/item',
  242. '<item',
  243. '<title', 'title2-transformed', '/title',
  244. '<guid', 'http://www.example.com/guid2', '/guid',
  245. '<link', 'http://www.example.com/link2', '/link',
  246. '<description', 'description2', '/description',
  247. '/item',
  248. '<item',
  249. '<title', 'title3-transformed', '/title',
  250. '<guid', 'http://www.example.com/guid3', '/guid',
  251. '<link', 'http://www.example.com/link3', '/link',
  252. '<description', 'description3', '/description',
  253. '/item'
  254. );
  255. $this->assertTags($result, $expected);
  256. $result = $this->Rss->items(array());
  257. $expected = '';
  258. $this->assertEquals($expected, $result);
  259. }
  260. /**
  261. * testItem method
  262. *
  263. * @return void
  264. */
  265. public function testItem() {
  266. $item = array(
  267. 'title' => 'My title',
  268. 'description' => 'My description',
  269. 'link' => 'http://www.google.com/'
  270. );
  271. $result = $this->Rss->item(null, $item);
  272. $expected = array(
  273. '<item',
  274. '<title',
  275. 'My title',
  276. '/title',
  277. '<description',
  278. 'My description',
  279. '/description',
  280. '<link',
  281. 'http://www.google.com/',
  282. '/link',
  283. '<guid',
  284. 'http://www.google.com/',
  285. '/guid',
  286. '/item'
  287. );
  288. $this->assertTags($result, $expected);
  289. $item = array(
  290. 'title' => 'My Title',
  291. 'link' => 'http://www.example.com/1',
  292. 'description' => 'descriptive words',
  293. 'pubDate' => '2008-05-31 12:00:00',
  294. 'source' => array('http://www.google.com/', 'Google'),
  295. 'guid' => 'http://www.example.com/1'
  296. );
  297. $result = $this->Rss->item(null, $item);
  298. $expected = array(
  299. '<item',
  300. '<title',
  301. 'My Title',
  302. '/title',
  303. '<link',
  304. 'http://www.example.com/1',
  305. '/link',
  306. '<description',
  307. 'descriptive words',
  308. '/description',
  309. '<pubDate',
  310. date('r', strtotime('2008-05-31 12:00:00')),
  311. '/pubDate',
  312. 'source' => array('url' => 'http://www.google.com/'),
  313. 'Google',
  314. '/source',
  315. '<guid',
  316. 'http://www.example.com/1',
  317. '/guid',
  318. '/item'
  319. );
  320. $this->assertTags($result, $expected);
  321. $item = array(
  322. 'title' => 'My Title & more'
  323. );
  324. $result = $this->Rss->item(null, $item);
  325. $expected = array(
  326. '<item',
  327. '<title', 'My Title &amp; more', '/title',
  328. '/item'
  329. );
  330. $this->assertTags($result, $expected);
  331. $item = array(
  332. 'title' => 'Foo bar',
  333. 'link' => array(
  334. 'url' => 'http://example.com/foo?a=1&b=2',
  335. 'convertEntities' => false
  336. ),
  337. 'description' => array(
  338. 'value' => 'descriptive words',
  339. 'cdata' => true,
  340. ),
  341. 'pubDate' => '2008-05-31 12:00:00',
  342. 'source' => 'http://www.google.com/'
  343. );
  344. $result = $this->Rss->item(null, $item);
  345. $expected = array(
  346. '<item',
  347. '<title',
  348. 'Foo bar',
  349. '/title',
  350. '<link',
  351. 'http://example.com/foo?a=1&amp;b=2',
  352. '/link',
  353. '<description',
  354. '<![CDATA[descriptive words]]',
  355. '/description',
  356. '<pubDate',
  357. date('r', strtotime('2008-05-31 12:00:00')),
  358. '/pubDate',
  359. '<source',
  360. 'http://www.google.com/',
  361. '/source',
  362. '<guid',
  363. 'http://example.com/foo?a=1&amp;b=2',
  364. '/guid',
  365. '/item'
  366. );
  367. $this->assertTags($result, $expected);
  368. $item = array(
  369. 'title' => 'My title',
  370. 'description' => 'My description',
  371. 'link' => 'http://www.google.com/',
  372. 'source' => array('url' => 'http://www.example.com/', 'title' => 'Example website')
  373. );
  374. $result = $this->Rss->item(null, $item);
  375. $expected = array(
  376. '<item',
  377. '<title',
  378. 'My title',
  379. '/title',
  380. '<description',
  381. 'My description',
  382. '/description',
  383. '<link',
  384. 'http://www.google.com/',
  385. '/link',
  386. 'source' => array('url' => 'http://www.example.com/'),
  387. 'Example website',
  388. '/source',
  389. '<guid',
  390. 'http://www.google.com/',
  391. '/guid',
  392. '/item'
  393. );
  394. $this->assertTags($result, $expected);
  395. $item = array(
  396. 'title' => 'My title',
  397. 'description' => 'My description',
  398. 'link' => 'http://www.google.com/',
  399. 'category' => array('Category One', 'Category Two')
  400. );
  401. $result = $this->Rss->item(null, $item);
  402. $expected = array(
  403. '<item',
  404. '<title',
  405. 'My title',
  406. '/title',
  407. '<description',
  408. 'My description',
  409. '/description',
  410. '<link',
  411. 'http://www.google.com/',
  412. '/link',
  413. '<category',
  414. 'Category One',
  415. '/category',
  416. '<category',
  417. 'Category Two',
  418. '/category',
  419. '<guid',
  420. 'http://www.google.com/',
  421. '/guid',
  422. '/item'
  423. );
  424. $this->assertTags($result, $expected);
  425. }
  426. /**
  427. * test item() with cdata blocks.
  428. *
  429. * @return void
  430. */
  431. public function testItemCdata() {
  432. $item = array(
  433. 'title' => array(
  434. 'value' => 'My Title & more',
  435. 'cdata' => true,
  436. 'convertEntities' => false,
  437. )
  438. );
  439. $result = $this->Rss->item(null, $item);
  440. $expected = array(
  441. '<item',
  442. '<title',
  443. '<![CDATA[My Title & more]]',
  444. '/title',
  445. '/item'
  446. );
  447. $this->assertTags($result, $expected);
  448. $item = array(
  449. 'category' => array(
  450. 'value' => 'CakePHP',
  451. 'cdata' => true,
  452. 'domain' => 'http://www.cakephp.org',
  453. )
  454. );
  455. $result = $this->Rss->item(null, $item);
  456. $expected = array(
  457. '<item',
  458. 'category' => array('domain' => 'http://www.cakephp.org'),
  459. '<![CDATA[CakePHP]]',
  460. '/category',
  461. '/item'
  462. );
  463. $this->assertTags($result, $expected);
  464. $item = array(
  465. 'category' => array(
  466. array(
  467. 'value' => 'CakePHP',
  468. 'cdata' => true,
  469. 'domain' => 'http://www.cakephp.org'
  470. ),
  471. array(
  472. 'value' => 'Bakery',
  473. 'cdata' => true
  474. )
  475. )
  476. );
  477. $result = $this->Rss->item(null, $item);
  478. $expected = array(
  479. '<item',
  480. 'category' => array('domain' => 'http://www.cakephp.org'),
  481. '<![CDATA[CakePHP]]',
  482. '/category',
  483. '<category',
  484. '<![CDATA[Bakery]]',
  485. '/category',
  486. '/item'
  487. );
  488. $this->assertTags($result, $expected);
  489. $item = array(
  490. 'title' => array(
  491. 'value' => 'My Title',
  492. 'cdata' => true,
  493. ),
  494. 'link' => 'http://www.example.com/1',
  495. 'description' => array(
  496. 'value' => 'descriptive words',
  497. 'cdata' => true,
  498. ),
  499. 'enclosure' => array(
  500. 'url' => '/test.flv'
  501. ),
  502. 'pubDate' => '2008-05-31 12:00:00',
  503. 'guid' => 'http://www.example.com/1',
  504. 'category' => array(
  505. array(
  506. 'value' => 'CakePHP',
  507. 'cdata' => true,
  508. 'domain' => 'http://www.cakephp.org'
  509. ),
  510. array(
  511. 'value' => 'Bakery',
  512. 'cdata' => true
  513. )
  514. )
  515. );
  516. $result = $this->Rss->item(null, $item);
  517. $expected = array(
  518. '<item',
  519. '<title',
  520. '<![CDATA[My Title]]',
  521. '/title',
  522. '<link',
  523. 'http://www.example.com/1',
  524. '/link',
  525. '<description',
  526. '<![CDATA[descriptive words]]',
  527. '/description',
  528. 'enclosure' => array('url' => $this->Rss->url('/test.flv', true)),
  529. '<pubDate',
  530. date('r', strtotime('2008-05-31 12:00:00')),
  531. '/pubDate',
  532. '<guid',
  533. 'http://www.example.com/1',
  534. '/guid',
  535. 'category' => array('domain' => 'http://www.cakephp.org'),
  536. '<![CDATA[CakePHP]]',
  537. '/category',
  538. '<category',
  539. '<![CDATA[Bakery]]',
  540. '/category',
  541. '/item'
  542. );
  543. $this->assertTags($result, $expected);
  544. }
  545. /**
  546. * test item() with enclosure data.
  547. *
  548. * @return void
  549. */
  550. public function testItemEnclosureLength() {
  551. if (!is_writable(WWW_ROOT)) {
  552. $this->markTestSkipped('Webroot is not writable.');
  553. }
  554. $testExists = is_dir(WWW_ROOT . 'tests');
  555. $tmpFile = WWW_ROOT . 'tests/cakephp.file.test.tmp';
  556. $File = new File($tmpFile, true);
  557. $this->assertTrue($File->write('123'), 'Could not write to ' . $tmpFile);
  558. clearstatcache();
  559. $item = array(
  560. 'title' => array(
  561. 'value' => 'My Title',
  562. 'cdata' => true,
  563. ),
  564. 'link' => 'http://www.example.com/1',
  565. 'description' => array(
  566. 'value' => 'descriptive words',
  567. 'cdata' => true,
  568. ),
  569. 'enclosure' => array(
  570. 'url' => '/tests/cakephp.file.test.tmp'
  571. ),
  572. 'pubDate' => '2008-05-31 12:00:00',
  573. 'guid' => 'http://www.example.com/1',
  574. 'category' => array(
  575. array(
  576. 'value' => 'CakePHP',
  577. 'cdata' => true,
  578. 'domain' => 'http://www.cakephp.org'
  579. ),
  580. array(
  581. 'value' => 'Bakery',
  582. 'cdata' => true
  583. )
  584. )
  585. );
  586. $result = $this->Rss->item(null, $item);
  587. if (!function_exists('mime_content_type')) {
  588. $type = null;
  589. } else {
  590. $type = mime_content_type($tmpFile);
  591. }
  592. $expected = array(
  593. '<item',
  594. '<title',
  595. '<![CDATA[My Title]]',
  596. '/title',
  597. '<link',
  598. 'http://www.example.com/1',
  599. '/link',
  600. '<description',
  601. '<![CDATA[descriptive words]]',
  602. '/description',
  603. 'enclosure' => array(
  604. 'url' => $this->Rss->url('/tests/cakephp.file.test.tmp', true),
  605. 'length' => filesize($tmpFile),
  606. 'type' => $type
  607. ),
  608. '<pubDate',
  609. date('r', strtotime('2008-05-31 12:00:00')),
  610. '/pubDate',
  611. '<guid',
  612. 'http://www.example.com/1',
  613. '/guid',
  614. 'category' => array('domain' => 'http://www.cakephp.org'),
  615. '<![CDATA[CakePHP]]',
  616. '/category',
  617. '<category',
  618. '<![CDATA[Bakery]]',
  619. '/category',
  620. '/item'
  621. );
  622. if ($type === null) {
  623. unset($expected['enclosure']['type']);
  624. }
  625. $this->assertTags($result, $expected);
  626. $File->delete();
  627. if (!$testExists) {
  628. $Folder = new Folder(WWW_ROOT . 'tests');
  629. $Folder->delete();
  630. }
  631. }
  632. /**
  633. * testElementAttrNotInParent method
  634. *
  635. * @return void
  636. */
  637. public function testElementAttrNotInParent() {
  638. $attributes = array(
  639. 'title' => 'Some Title',
  640. 'link' => 'http://link.com',
  641. 'description' => 'description'
  642. );
  643. $elements = array('enclosure' => array('url' => 'http://test.com'));
  644. $result = $this->Rss->item($attributes, $elements);
  645. $expected = array(
  646. 'item' => array(
  647. 'title' => 'Some Title',
  648. 'link' => 'http://link.com',
  649. 'description' => 'description'
  650. ),
  651. 'enclosure' => array(
  652. 'url' => 'http://test.com'
  653. ),
  654. '/item'
  655. );
  656. $this->assertTags($result, $expected);
  657. }
  658. public function testElementNamespaceWithoutPrefix() {
  659. $item = array(
  660. 'creator' => 'Alex',
  661. );
  662. $attributes = array(
  663. 'namespace' => 'http://link.com'
  664. );
  665. $result = $this->Rss->item($attributes, $item);
  666. $expected = array(
  667. 'item' => array(
  668. 'xmlns' => 'http://link.com'
  669. ),
  670. 'creator' => array(
  671. 'xmlns' => 'http://link.com'
  672. ),
  673. 'Alex',
  674. '/creator',
  675. '/item'
  676. );
  677. $this->assertTags($result, $expected, true);
  678. }
  679. public function testElementNamespaceWithPrefix() {
  680. $item = array(
  681. 'title' => 'Title',
  682. 'dc:creator' => 'Alex',
  683. 'dc:description' => 'descriptive words'
  684. );
  685. $attributes = array(
  686. 'namespace' => array(
  687. 'prefix' => 'dc',
  688. 'url' => 'http://link.com'
  689. )
  690. );
  691. $result = $this->Rss->item($attributes, $item);
  692. $expected = array(
  693. 'item' => array(
  694. 'xmlns:dc' => 'http://link.com'
  695. ),
  696. 'title' => array(
  697. 'xmlns:dc' => 'http://link.com'
  698. ),
  699. 'Title',
  700. '/title',
  701. 'dc:creator' => array(
  702. 'xmlns:dc' => 'http://link.com'
  703. ),
  704. 'Alex',
  705. '/dc:creator',
  706. 'dc:description' => array(
  707. 'xmlns:dc' => 'http://link.com'
  708. ),
  709. 'descriptive words',
  710. '/dc:description',
  711. '/item'
  712. );
  713. $this->assertTags($result, $expected, true);
  714. }
  715. }