public function testCDATACannotBeTricked() { $root = new SimpleDOM('<root />'); $expected = '<root><![CDATA[<![CDATA[some data]]]]><![CDATA[>]]></root>'; $root->insertCDATA('<![CDATA[some data]]>', 'append'); $this->assertXmlStringEqualsXmlString($expected, $root->asXML()); }