Skip to content

Commit 6572d67

Browse files
committed
testLoadHtml generate original html string from xml
Tests: - Convert a html string to SimpleXmlElement - Access to html nodes in SimpleXmlElement - Nodes content - Regenerate the original html string from SimpleXmlElement
1 parent 6265846 commit 6572d67

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

tests/TestCase/Utility/XmlTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,12 +270,14 @@ public function testLoadHtml()
270270
$this->assertEquals($paragraph, (string)$xml->body->p);
271271
$this->assertTrue(isset($xml->body->blockquote), 'Blockquote present');
272272
$this->assertEquals($blockquote, (string)$xml->body->blockquote);
273+
$this->assertEquals($html, "<!DOCTYPE html>\n" . $xml->asXML());
273274

274275
$xml = Xml::loadHtml($html, ['parseHuge' => true]);
275276
$this->assertTrue(isset($xml->body->p), 'Paragraph present');
276277
$this->assertEquals($paragraph, (string)$xml->body->p);
277278
$this->assertTrue(isset($xml->body->blockquote), 'Blockquote present');
278279
$this->assertEquals($blockquote, (string)$xml->body->blockquote);
280+
$this->assertEquals($html, "<!DOCTYPE html>\n" . $xml->asXML());
279281
}
280282

281283
/**

0 commit comments

Comments
 (0)