Skip to content

Commit 0a4d1f2

Browse files
committed
Merge remote-tracking branch 'origin/MAGETWO-34069-Github-Bug-1035' into develop
2 parents bf01a4b + bf736ec commit 0a4d1f2

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

dev/tests/unit/testsuite/Magento/Framework/Simplexml/ElementTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,12 @@ public function testAppendChild()
7272
$baseXml = simplexml_load_string('<root/>', 'Magento\Framework\Simplexml\Element');
7373
/** @var \Magento\Framework\Simplexml\Element $appendXml */
7474
$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>',
7676
'Magento\Framework\Simplexml\Element'
7777
);
7878
$baseXml->appendChild($appendXml);
7979

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>';
8181
$this->assertXmlStringEqualsXmlString($expectedXml, $baseXml->asNiceXml());
8282
}
8383

lib/internal/Magento/Framework/Simplexml/Element.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ public function xmlentities($value = null)
326326
*/
327327
public function appendChild($source)
328328
{
329-
if ($source->children()) {
329+
if ($source->count()) {
330330
$child = $this->addChild($source->getName());
331331
} else {
332332
$child = $this->addChild($source->getName(), $this->xmlentities($source));

0 commit comments

Comments
 (0)