Magento Extensions Rating 2024
EXTENSIONS BY CATEGORY
B2B (Business-To-Business)
Blog
Customer
ERP (Enterprise Resource Planning)
Mega Menu
One Step Checkout
Order
POS (Point Of Sale)
Search
Shopping Cart
Sitemap
SEO
Social
Stock & Inventory Management
EXTENSIONS BY DEVELOPER
aheadWorks
Amasty
Boost My Shop
BSS Commerce
Magestore
MageWorx
Mirasvit
Templates Master
Wyomind
XTENTO
Magento 2 Documentation
Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
vendor
magento
framework
Convert
Test
Unit
XmlTest.php
Go to the documentation of this file.
1
<?php
6
namespace
Magento\Framework\Convert\Test\Unit
;
7
8
class
XmlTest
extends
\PHPUnit\Framework\TestCase
9
{
13
protected
$_model
;
14
15
protected
function
setUp
()
16
{
17
$this->_model = new \Magento\Framework\Convert\Xml();
18
}
19
20
public
function
testXmlToAssoc
()
21
{
22
$xmlstr = $this->
getXml
();
23
$result
= $this->_model->xmlToAssoc(
new
\SimpleXMLElement($xmlstr));
24
$this->assertEquals(
25
[
26
'one'
=>
'1'
,
27
'two'
=> [
'three'
=>
'3'
,
'four'
=>
'4'
],
28
'five'
=> [0 =>
'5'
, 1 =>
'6'
],
29
],
30
$result
31
);
32
}
33
37
protected
function
getXml
()
38
{
39
return
<<<XML
40
<?xml version=
"1.0"
encoding=
"UTF-8"
standalone=
"yes"
?>
41
<_><one>1</one><two><three>3</three><four>4</four></two><five><five>5</five><five>6</five></five></_>
42
XML;
43
}
44
}
$result
$result
Definition:
product_configurable_not_available_rollback.php:26
Magento\Framework\Convert\Test\Unit\XmlTest\$_model
$_model
Definition:
XmlTest.php:13
Magento\Framework\Convert\Test\Unit
Definition:
ConvertArrayTest.php:7
Magento\Framework\Convert\Test\Unit\XmlTest\testXmlToAssoc
testXmlToAssoc()
Definition:
XmlTest.php:20
Magento\Framework\Convert\Test\Unit\XmlTest\setUp
setUp()
Definition:
XmlTest.php:15
Magento\Framework\Convert\Test\Unit\XmlTest\getXml
getXml()
Definition:
XmlTest.php:37
Magento\Framework\Convert\Test\Unit\XmlTest
Definition:
XmlTest.php:8