Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
ArgumentParserTest.php
Go to the documentation of this file.
1 <?php
7 
8 use \Magento\Framework\ObjectManager\Config\Mapper\ArgumentParser;
9 
10 class ArgumentParserTest extends \PHPUnit\Framework\TestCase
11 {
12  public function testParse()
13  {
14  $document = new \DOMDocument();
15  $document->load(__DIR__ . '/_files/argument_parser.xml');
16  $parser = new ArgumentParser();
17  $actual = $parser->parse($document->getElementsByTagName('argument')->item(0));
18  $expected = [
19  'item' => [
20  'one' => ['name' => 'one', 'value' => 'value1'],
21  'nested' => [
22  'name' => 'nested',
23  'item' => [
24  'two' => ['name' => 'two', 'value' => 'value2'],
25  'three' => ['name' => 'three', 'value' => 'value3'],
26  ],
27  ],
28  ],
29  ];
30  $this->assertSame($expected, $actual);
31  }
32 }
defined('TESTS_BP')||define('TESTS_BP' __DIR__
Definition: _bootstrap.php:60