From ee882bfe47ae52c43f10c2fedea63472134e407d Mon Sep 17 00:00:00 2001 From: Vladimir Pelipenko Date: Tue, 20 Jan 2015 13:21:05 +0200 Subject: [PATCH] MAGETWO-32829: [GITHUB] Add tests for View\Layout\Reader\Block and slight refactoring #906 - fixed code style and added lost copyright blocks --- .../View/Layout/Reader/BlockTest.php | 21 +++++++++++++------ .../Reader/_files/_layout_update_block.xml | 15 ++++++------- .../_files/_layout_update_reference.xml | 9 ++++++-- 3 files changed, 30 insertions(+), 15 deletions(-) diff --git a/dev/tests/integration/testsuite/Magento/Framework/View/Layout/Reader/BlockTest.php b/dev/tests/integration/testsuite/Magento/Framework/View/Layout/Reader/BlockTest.php index f6cd7b1b6afd9..3bd3e7f3024f1 100644 --- a/dev/tests/integration/testsuite/Magento/Framework/View/Layout/Reader/BlockTest.php +++ b/dev/tests/integration/testsuite/Magento/Framework/View/Layout/Reader/BlockTest.php @@ -1,5 +1,8 @@ block = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( 'Magento\Framework\View\Layout\Reader\Block' ); - $this->readerContext = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( 'Magento\Framework\View\Layout\Reader\Context' ); @@ -33,12 +42,13 @@ public function setUp() public function testInterpretBlockDirective() { - $pageXml = new \Magento\Framework\View\Layout\Element(__DIR__ . '/_files/_layout_update_block.xml', 0, true); + $pageXml = new \Magento\Framework\View\Layout\Element( + __DIR__ . '/_files/_layout_update_block.xml', 0, true + ); $parentElement = new \Magento\Framework\View\Layout\Element(''); foreach ($pageXml->xpath('body/block') as $blockElement) { $this->assertTrue(in_array($blockElement->getName(), $this->block->getSupportedNodes())); - $this->block->interpret($this->readerContext, $blockElement, $parentElement); } @@ -73,7 +83,6 @@ public function testInterpretReferenceBlockDirective() foreach ($pageXml->xpath('body/*') as $element) { $this->assertTrue(in_array($element->getName(), $this->block->getSupportedNodes())); - $this->block->interpret($this->readerContext, $element, $parentElement); } @@ -88,4 +97,4 @@ public function testInterpretReferenceBlockDirective() $resultElementData['arguments'] ); } -} +} diff --git a/dev/tests/integration/testsuite/Magento/Framework/View/Layout/Reader/_files/_layout_update_block.xml b/dev/tests/integration/testsuite/Magento/Framework/View/Layout/Reader/_files/_layout_update_block.xml index 0a3c9c962ca55..01cf6bf5dd2b3 100644 --- a/dev/tests/integration/testsuite/Magento/Framework/View/Layout/Reader/_files/_layout_update_block.xml +++ b/dev/tests/integration/testsuite/Magento/Framework/View/Layout/Reader/_files/_layout_update_block.xml @@ -1,12 +1,13 @@ - + + - + test-argument-value diff --git a/dev/tests/integration/testsuite/Magento/Framework/View/Layout/Reader/_files/_layout_update_reference.xml b/dev/tests/integration/testsuite/Magento/Framework/View/Layout/Reader/_files/_layout_update_reference.xml index 36a01a41bffb5..f25d5cecda8a3 100644 --- a/dev/tests/integration/testsuite/Magento/Framework/View/Layout/Reader/_files/_layout_update_reference.xml +++ b/dev/tests/integration/testsuite/Magento/Framework/View/Layout/Reader/_files/_layout_update_reference.xml @@ -1,6 +1,11 @@ - + +