From 6572d676b7601f8255f5e63be9be3ac5e161a711 Mon Sep 17 00:00:00 2001 From: Fernando Herrero Date: Sun, 3 Jun 2018 01:44:11 +0200 Subject: [PATCH] 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 --- tests/TestCase/Utility/XmlTest.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/TestCase/Utility/XmlTest.php b/tests/TestCase/Utility/XmlTest.php index 6ccf2bb641a..b2b7a2a1308 100644 --- a/tests/TestCase/Utility/XmlTest.php +++ b/tests/TestCase/Utility/XmlTest.php @@ -270,12 +270,14 @@ public function testLoadHtml() $this->assertEquals($paragraph, (string)$xml->body->p); $this->assertTrue(isset($xml->body->blockquote), 'Blockquote present'); $this->assertEquals($blockquote, (string)$xml->body->blockquote); + $this->assertEquals($html, "\n" . $xml->asXML()); $xml = Xml::loadHtml($html, ['parseHuge' => true]); $this->assertTrue(isset($xml->body->p), 'Paragraph present'); $this->assertEquals($paragraph, (string)$xml->body->p); $this->assertTrue(isset($xml->body->blockquote), 'Blockquote present'); $this->assertEquals($blockquote, (string)$xml->body->blockquote); + $this->assertEquals($html, "\n" . $xml->asXML()); } /**