Skip to content

Commit 7a30c0e

Browse files
committed
Unit test to get Atom feed entry content when document does not have an encoding.
1 parent 76f537d commit 7a30c0e

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

test/Reader/Entry/AtomStandaloneEntryTest.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,19 @@ public function testGetsContentFromAtom10XhtmlNamespaced(): void
249249
$this->assertEquals('<p class="x:"><em>Entry Content &amp;x:</em></p>', $entry->getContent());
250250
}
251251

252+
/**
253+
* XHTML document does not have encoding
254+
*
255+
* @group LaminasRATOMCONTENT
256+
*/
257+
public function testGetsContentFromAtom10XhtmlNamespacedNoEncoding(): void
258+
{
259+
$entry = Reader\Reader::importString(
260+
file_get_contents($this->feedSamplePath . '/content/atom10_XhtmlNoEncoding.xml')
261+
);
262+
$this->assertEquals('<p class="x:"><em>Entry Content &amp;x:</em></p>', $entry->getContent());
263+
}
264+
252265
/**
253266
* Get Link (Unencoded Text)
254267
*
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" ?>
2+
<entry xmlns="http://www.w3.org/2005/Atom">
3+
<content type="xhtml" xmlns:x="http://www.w3.org/1999/xhtml">
4+
<x:div>
5+
<x:p class="x:"><x:em>Entry Content &amp;x:</x:em></x:p>
6+
</x:div>
7+
</content>
8+
</entry>

0 commit comments

Comments
 (0)