Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
DepsTest.php
Go to the documentation of this file.
1 <?php
7 
11 
12 class DepsTest extends \PHPUnit\Framework\TestCase
13 {
17  private $converter;
18 
19  public function setUp()
20  {
21  $this->converter = new Deps(new ConverterUtils());
22  }
23 
24  public function testConvert()
25  {
26  $expectedResult = [
27  'name' => 'deps',
28  'xsi:type' => 'array',
29  'item' => [
30  [
31  'name' => 0,
32  'xsi:type' => 'string',
33  'value' => 'test-dep',
34  ],
35  [
36  'name' => 1,
37  'xsi:type' => 'string',
38  'value' => 'test-dep-two',
39  ],
40  ],
41  ];
42  $dom = new \DOMDocument('1.0', 'UTF-8');
43  $dom->load(dirname(__FILE__) . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . 'test.xml');
44  $domXpath = new \DOMXPath($dom);
45  $deps = $domXpath->query('//listing/settings/deps')->item(0);
46  $this->assertEquals($expectedResult, $this->converter->convert($deps));
47  }
48 }
defined('MTF_BOOT_FILE')||define('MTF_BOOT_FILE' __FILE__
Definition: bootstrap.php:7