You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: tests/Array2XmlTest.php
+57-11Lines changed: 57 additions & 11 deletions
Original file line number
Diff line number
Diff line change
@@ -59,29 +59,75 @@ class Array2XmlTest extends TestCase
59
59
];
60
60
61
61
/**
62
-
* Expected xml string
62
+
* Throw DOMException when there are more than one root node
63
63
*
64
-
* @var string
64
+
* @test
65
+
*
66
+
* @return void
65
67
*/
66
-
protected$expected_xml_string = '<?xml version="1.0" encoding="UTF-8"?><root_node><tag>Example tag</tag><attribute_tag description="This is a tag with attribute">Another tag with attributes</attribute_tag><cdata_section><![CDATA[This is CDATA section]]></cdata_section><tag_with_subtag><sub_tag>Sub tag 1</sub_tag><sub_tag>Sub tag 2</sub_tag></tag_with_subtag><mixed_section>Hello<![CDATA[This is another CDATA section]]><section id="sec_1">Section number 1</section><section id="sec_2">Section number 2</section><section id="sec_3">Section number 3</section></mixed_section><example:with_namespace xmlns:example="http://example.com"><example:sub>Content</example:sub></example:with_namespace></root_node>';
$this->expectExceptionMessage('XML documents are allowed only one root element. Wrap your elements in a key or set the `rootElement` parameter in the configuration.');
0 commit comments