diff --git a/dev/tests/unit/testsuite/Magento/Framework/Simplexml/ElementTest.php b/dev/tests/unit/testsuite/Magento/Framework/Simplexml/ElementTest.php index 48973d01e3fd4..2532ca987449d 100644 --- a/dev/tests/unit/testsuite/Magento/Framework/Simplexml/ElementTest.php +++ b/dev/tests/unit/testsuite/Magento/Framework/Simplexml/ElementTest.php @@ -72,12 +72,12 @@ public function testAppendChild() $baseXml = simplexml_load_string('', 'Magento\Framework\Simplexml\Element'); /** @var \Magento\Framework\Simplexml\Element $appendXml */ $appendXml = simplexml_load_string( - 'text', + 'text', 'Magento\Framework\Simplexml\Element' ); $baseXml->appendChild($appendXml); - $expectedXml = 'text'; + $expectedXml = 'text'; $this->assertXmlStringEqualsXmlString($expectedXml, $baseXml->asNiceXml()); } diff --git a/lib/internal/Magento/Framework/Simplexml/Element.php b/lib/internal/Magento/Framework/Simplexml/Element.php index 98c881f1dd274..d8293fb802328 100644 --- a/lib/internal/Magento/Framework/Simplexml/Element.php +++ b/lib/internal/Magento/Framework/Simplexml/Element.php @@ -326,7 +326,7 @@ public function xmlentities($value = null) */ public function appendChild($source) { - if ($source->children()) { + if ($source->count()) { $child = $this->addChild($source->getName()); } else { $child = $this->addChild($source->getName(), $this->xmlentities($source));