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
Xml
Test
Unit
ParserTest.php
Go to the documentation of this file.
1
<?php
7
namespace
Magento\Framework\Xml\Test\Unit
;
8
9
class
ParserTest
extends
\PHPUnit\Framework\TestCase
10
{
12
protected
$parser
;
13
14
protected
function
setUp
()
15
{
16
if
(!
function_exists
(
'libxml_set_external_entity_loader'
)) {
17
$this->markTestSkipped(
'Skipped on HHVM. Will be fixed in MAGETWO-45033'
);
18
}
19
$this->parser = new \Magento\Framework\Xml\Parser();
20
}
21
22
public
function
testGetXml
()
23
{
24
$this->assertEquals(
25
[
'data'
=> [
26
'nodes'
=> [
27
'text'
=>
' some text '
,
28
'trim_spaces'
=>
''
,
29
'cdata'
=>
' Some data here <strong>html</strong> tags are <i>allowed</i> '
,
30
'zero'
=>
'0'
,
31
'null'
=>
null
,
32
]
33
]],
34
$this->parser->load(
__DIR__
.
'/_files/data.xml'
)->xmlToArray()
35
);
36
}
37
42
public
function
testLoadXmlInvalid
()
43
{
44
$sampleInvalidXml =
'<?xml version="1.0"?><config></onfig>'
;
45
$this->parser->initErrorHandler();
46
$this->parser->loadXML($sampleInvalidXml);
47
}
48
}
Magento\Framework\Xml\Test\Unit\ParserTest
Definition:
ParserTest.php:9
Magento\Framework\Xml\Test\Unit\ParserTest\setUp
setUp()
Definition:
ParserTest.php:14
Magento\Framework\Xml\Test\Unit\ParserTest\testGetXml
testGetXml()
Definition:
ParserTest.php:22
Magento\Framework\Xml\Test\Unit
Definition:
ParserTest.php:7
__DIR__
defined('TESTS_BP')||define('TESTS_BP' __DIR__
Definition:
_bootstrap.php:60
Magento\Framework\Xml\Test\Unit\ParserTest\testLoadXmlInvalid
testLoadXmlInvalid()
Definition:
ParserTest.php:42
Magento\Framework\Xml\Test\Unit\ParserTest\$parser
$parser
Definition:
ParserTest.php:12
Magento\Deploy\Console\Command\function_exists
function_exists($func)
Definition:
FunctionExistMock.php:13