This repository was archived by the owner on Oct 2, 2019. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed
tests/Zend/Feed/Writer/Renderer/Entry Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -433,7 +433,8 @@ protected function _mapFeedEntries(DOMElement $root, $array)
433
433
434
434
if (isset ($ dataentry ->category )) {
435
435
foreach ($ dataentry ->category as $ category ) {
436
- $ node = $ this ->_element ->createElement ('category ' , $ category ['term ' ]);
436
+ $ node = $ this ->_element ->createElement ('category ' );
437
+ $ node ->appendChild ($ this ->_element ->createCDATASection ($ category ['term ' ]));
437
438
if (isset ($ category ['scheme ' ])) {
438
439
$ node ->setAttribute ('domain ' , $ category ['scheme ' ]);
439
440
}
Original file line number Diff line number Diff line change @@ -367,4 +367,17 @@ public function testCategoriesCharDataEncoding()
367
367
$ this ->assertEquals ($ expected , (array ) $ entry ->getCategories ());
368
368
}
369
369
370
+ /**
371
+ * @group GH-461
372
+ */
373
+ public function testCategoryHasCDataSection ()
374
+ {
375
+ $ this ->_validEntry ->addCategory (array (
376
+ 'term ' => 'This is a test category ' ,
377
+ ));
378
+ $ renderer = new Zend_Feed_Writer_Renderer_Feed_Rss ($ this ->_validWriter );
379
+ $ xmlString = $ renderer ->render ()->saveXml ();
380
+ $ this ->assertContains ('<category><![CDATA[This is a test category]]></category> ' , $ xmlString );
381
+ }
382
+
370
383
}
You can’t perform that action at this time.
0 commit comments