File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed
dev/tests/unit/testsuite/Magento/Framework/Simplexml
lib/internal/Magento/Framework/Simplexml Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -72,12 +72,12 @@ public function testAppendChild()
72
72
$ baseXml = simplexml_load_string ('<root/> ' , 'Magento\Framework\Simplexml\Element ' );
73
73
/** @var \Magento\Framework\Simplexml\Element $appendXml */
74
74
$ appendXml = simplexml_load_string (
75
- '<node_a attr="abc"><node_b>text</node_b></node_a> ' ,
75
+ '<node_a attr="abc"><node_b innerAttribute="xyz" >text</node_b></node_a> ' ,
76
76
'Magento\Framework\Simplexml\Element '
77
77
);
78
78
$ baseXml ->appendChild ($ appendXml );
79
79
80
- $ expectedXml = '<root><node_a attr="abc"><node_b>text</node_b></node_a></root> ' ;
80
+ $ expectedXml = '<root><node_a attr="abc"><node_b innerAttribute="xyz" >text</node_b></node_a></root> ' ;
81
81
$ this ->assertXmlStringEqualsXmlString ($ expectedXml , $ baseXml ->asNiceXml ());
82
82
}
83
83
Original file line number Diff line number Diff line change @@ -326,7 +326,7 @@ public function xmlentities($value = null)
326
326
*/
327
327
public function appendChild ($ source )
328
328
{
329
- if ($ source ->children ()) {
329
+ if ($ source ->count ()) {
330
330
$ child = $ this ->addChild ($ source ->getName ());
331
331
} else {
332
332
$ child = $ this ->addChild ($ source ->getName (), $ this ->xmlentities ($ source ));
You can’t perform that action at this time.
0 commit comments