DomTest.php 985 B

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Framework\Config\Test\Unit\Converter;
  7. use \Magento\Framework\Config\Converter\Dom;
  8. class DomTest extends \PHPUnit\Framework\TestCase
  9. {
  10. /**
  11. * @param string $sourceFile
  12. * @param string $resultFile
  13. * @dataProvider convertDataProvider
  14. */
  15. public function testConvert($sourceFile, $resultFile)
  16. {
  17. $dom = new \DOMDocument();
  18. $dom->loadXML(file_get_contents(__DIR__ . "/../_files/converter/dom/{$sourceFile}"));
  19. $resultFile = include __DIR__ . "/../_files/converter/dom/{$resultFile}";
  20. $converterDom = new Dom();
  21. $this->assertEquals($resultFile, $converterDom->convert($dom));
  22. }
  23. /**
  24. * @return array
  25. */
  26. public function convertDataProvider()
  27. {
  28. return [
  29. ['cdata.xml', 'cdata.php'],
  30. ['attributes.xml', 'attributes.php',],
  31. ];
  32. }
  33. }