From ffe92e27545abbd1b262c0ea01e9b09ddbcf275e Mon Sep 17 00:00:00 2001 From: Vinai Kopp Date: Thu, 8 Jan 2015 17:01:00 +0100 Subject: [PATCH] Add integration test for View\Page\Config\Reader\Html --- .../View/Page/Config/Reader/HtmlTest.php | 25 +++++++++++++++++++ .../Config/Reader/_files/_layout_update.xml | 6 +++++ 2 files changed, 31 insertions(+) create mode 100644 dev/tests/integration/testsuite/Magento/Framework/View/Page/Config/Reader/HtmlTest.php create mode 100644 dev/tests/integration/testsuite/Magento/Framework/View/Page/Config/Reader/_files/_layout_update.xml diff --git a/dev/tests/integration/testsuite/Magento/Framework/View/Page/Config/Reader/HtmlTest.php b/dev/tests/integration/testsuite/Magento/Framework/View/Page/Config/Reader/HtmlTest.php new file mode 100644 index 0000000000000..fe4b37b212e00 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Framework/View/Page/Config/Reader/HtmlTest.php @@ -0,0 +1,25 @@ +create( + 'Magento\Framework\View\Layout\Reader\Context' + ); + $pageXml = new \Magento\Framework\View\Layout\Element(__DIR__ . '/_files/_layout_update.xml', 0, true); + $parentElement = new \Magento\Framework\View\Layout\Element(''); + + $html = new Html(); + foreach ($pageXml->xpath('html') as $htmlElement) { + $html->interpret($readerContext, $htmlElement, $parentElement); + } + + $structure = $readerContext->getPageConfigStructure(); + $this->assertEquals(['html' => ['test-name' => 'test-value']], $structure->getElementAttributes()); + } +} diff --git a/dev/tests/integration/testsuite/Magento/Framework/View/Page/Config/Reader/_files/_layout_update.xml b/dev/tests/integration/testsuite/Magento/Framework/View/Page/Config/Reader/_files/_layout_update.xml new file mode 100644 index 0000000000000..6bd2c0871bd54 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Framework/View/Page/Config/Reader/_files/_layout_update.xml @@ -0,0 +1,6 @@ + + + + + +