diff --git a/dev/tests/integration/testsuite/Magento/Test/Tools/Layout/Reference/ProcessorTest.php b/dev/tests/integration/testsuite/Magento/Test/Tools/Layout/Reference/ProcessorTest.php deleted file mode 100644 index 4d9cf1941daaba68550db09841888a300d519596..0000000000000000000000000000000000000000 --- a/dev/tests/integration/testsuite/Magento/Test/Tools/Layout/Reference/ProcessorTest.php +++ /dev/null @@ -1,128 +0,0 @@ -<?php -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Test\Tools\Layout\Reference; - -use Magento\Framework\App\Filesystem\DirectoryList; -use Magento\Framework\Filesystem; -use Magento\Tools\Layout\Formatter; -use Magento\Tools\Layout\Reference\Processor; - -class ProcessorTest extends \PHPUnit_Framework_TestCase -{ - /** - * @var string - */ - protected $_testDir; - - /** - * @var string - */ - protected $_varDir; - - /** - * @var string - */ - protected $_dictionaryPath; - - /** - * @var \Magento\Tools\Layout\Reference\Processor - */ - protected $_processor; - - /** - * @var \Magento\Tools\Layout\Formatter - */ - protected $_formatter; - - protected function setUp() - { - if (!extension_loaded('xsl')) { - $this->markTestSkipped('XSL extension needed for XSLT Processor test'); - } - $this->_testDir = realpath(__DIR__ . '/_files') . '/'; - - /** @var Filesystem $filesystem */ - $filesystem = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() - ->get('Magento\Framework\Filesystem'); - $this->_varDir = $filesystem->getDirectoryWrite(DirectoryList::VAR_DIR)->getAbsolutePath('references/'); - mkdir($this->_varDir, 0777, true); - - $this->_formatter = new Formatter(); - $this->_dictionaryPath = $this->_varDir . 'references.xml'; - - $this->_processor = new Processor($this->_formatter, $this->_dictionaryPath); - } - - public function tearDown() - { - \Magento\Framework\System\Dirs::rm($this->_varDir); - } - - public function testGetReferences() - { - $this->_processor->getReferences([$this->_testDir . 'layoutValid.xml']); - $this->_processor->writeToFile(); - $expected = <<<EOF -<?xml version="1.0"?> -<list> - <item type="reference" value="block"/> - <item type="reference" value="container"/> - <item type="block" value="another.block"/> - <item type="block" value="block"/> - <item type="container" value="another.container"/> - <item type="container" value="container"/> -</list> - -EOF; - $this->assertEquals($expected, file_get_contents($this->_dictionaryPath)); - } - - public function testGetReferencesWithConflictNames() - { - $this->_processor->getReferences([$this->_testDir . 'layoutInvalid.xml']); - $this->_processor->writeToFile(); - $expected = <<<EOF -<?xml version="1.0"?> -<list> - <item type="reference" value="block"/> - <item type="reference" value="broken.reference"/> - <item type="block" value="another.block"/> - <item type="block" value="block"/> - <item type="container" value="block"/> - <item type="conflictReferences" value="broken.reference"/> - <item type="conflictNames" value="block"/> -</list> - -EOF; - $this->assertEquals($expected, file_get_contents($this->_dictionaryPath)); - } - - public function testUpdateReferences() - { - $testFile = $this->_varDir . 'layoutValid.xml'; - copy($this->_testDir . 'layoutValid.xml', $testFile); - - $layouts = [$testFile]; - $this->_processor->getReferences($layouts); - $this->_processor->writeToFile(); - $expected = <<<EOF -<?xml version="1.0"?> -<list> - <item type="reference" value="block"/> - <item type="reference" value="container"/> - <item type="block" value="another.block"/> - <item type="block" value="block"/> - <item type="container" value="another.container"/> - <item type="container" value="container"/> -</list> - -EOF; - $this->assertEquals($expected, file_get_contents($this->_dictionaryPath)); - - $this->_processor->updateReferences($layouts); - $this->assertFileEquals($this->_testDir . 'layoutValidExpectUpdated.xml', $testFile); - } -} diff --git a/dev/tests/integration/testsuite/Magento/Test/Tools/Layout/Reference/_files/layoutInvalid.xml b/dev/tests/integration/testsuite/Magento/Test/Tools/Layout/Reference/_files/layoutInvalid.xml deleted file mode 100644 index cae977ec34240a91de1107bfd5d26139ea782e14..0000000000000000000000000000000000000000 --- a/dev/tests/integration/testsuite/Magento/Test/Tools/Layout/Reference/_files/layoutInvalid.xml +++ /dev/null @@ -1,19 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ ---> -<layout> - <handle id="test"> - <block class="Magento\Framework\View\Element\Template" name="block"/> - <container name="block" label="Container"/> - <reference name="block"> - <block class="Magento\Framework\View\Element\Template" name="another.block"/> - </reference> - <reference name="broken.reference"> - <block class="Magento\Framework\View\Element\Template" name="another.block"/> - </reference> - </handle> -</layout> diff --git a/dev/tests/integration/testsuite/Magento/Test/Tools/Layout/Reference/_files/layoutValid.xml b/dev/tests/integration/testsuite/Magento/Test/Tools/Layout/Reference/_files/layoutValid.xml deleted file mode 100644 index f1923bea6beff1daf449ad42d246f038e304084f..0000000000000000000000000000000000000000 --- a/dev/tests/integration/testsuite/Magento/Test/Tools/Layout/Reference/_files/layoutValid.xml +++ /dev/null @@ -1,19 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ ---> -<layout> - <handle id="test"> - <block class="Magento\Framework\View\Element\Template" name="block"/> - <container name="container" label="Container"/> - <reference name="block"> - <block class="Magento\Framework\View\Element\Template" name="another.block"/> - </reference> - <reference name="container"> - <container name="another.container" label="Container"/> - </reference> - </handle> -</layout> diff --git a/dev/tests/integration/testsuite/Magento/Test/Tools/Layout/Reference/_files/layoutValidExpectUpdated.xml b/dev/tests/integration/testsuite/Magento/Test/Tools/Layout/Reference/_files/layoutValidExpectUpdated.xml deleted file mode 100644 index 7c6f0bf2e48ea14d8e240291ac60ddb17ece5686..0000000000000000000000000000000000000000 --- a/dev/tests/integration/testsuite/Magento/Test/Tools/Layout/Reference/_files/layoutValidExpectUpdated.xml +++ /dev/null @@ -1,19 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ ---> -<layout> - <handle id="test"> - <block class="Magento\Framework\View\Element\Template" name="block"/> - <container name="container" label="Container"/> - <referenceBlock name="block"> - <block class="Magento\Framework\View\Element\Template" name="another.block"/> - </referenceBlock> - <referenceContainer name="container"> - <container name="another.container" label="Container"/> - </referenceContainer> - </handle> -</layout> diff --git a/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_classes.php b/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_classes.php index 59cf16d245655b3613dbf2bcedbf296ef0ed4330..1c91c8c67bb351bc8325ed602b8e4d74c1681749 100755 --- a/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_classes.php +++ b/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_classes.php @@ -3334,4 +3334,6 @@ return [ ['Magento\Log\Model\LogFactory\Clean'], ['Magento\Log\Model\Shell\CommandInterface'], ['Magento\Framework\App\Filesystem\DirectoryList\AbstractShell'], + ['Magento\Tools\Layout\Reference'], + ['Magento\Tools\Layout\Formatter', 'Magento\Developer\Model\Tools\Formatter'] ];