ConverterTest.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <?php
  2. /**
  3. * \Magento\Theme\Model\Layout\Config\Converter
  4. *
  5. * Copyright © Magento, Inc. All rights reserved.
  6. * See COPYING.txt for license details.
  7. */
  8. namespace Magento\Theme\Test\Unit\Model\Layout\Config;
  9. class ConverterTest extends \PHPUnit\Framework\TestCase
  10. {
  11. /**
  12. * @var \Magento\Theme\Model\Layout\Config\Converter
  13. */
  14. protected $_model;
  15. /** @var array */
  16. protected $_targetArray;
  17. protected function setUp()
  18. {
  19. $this->_model = new \Magento\Theme\Model\Layout\Config\Converter();
  20. }
  21. public function testConvert()
  22. {
  23. $dom = new \DOMDocument();
  24. $xmlFile = __DIR__ . '/_files/page_layouts.xml';
  25. $dom->loadXML(file_get_contents($xmlFile));
  26. $expectedResult = [
  27. 'empty' => [
  28. 'label' => 'Empty',
  29. 'code' => 'empty',
  30. ],
  31. '1column' => [
  32. 'label' => '1 column',
  33. 'code' => '1column',
  34. ],
  35. ];
  36. $this->assertEquals($expectedResult, $this->_model->convert($dom), '', 0, 20);
  37. }
  38. }