RssHelperTest.php 23 KB

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