RssHelperTest.php 18 KB

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