Skip to content

Commit

Permalink
Merge pull request #902 from Vinai/page-config-reader-html
Browse files Browse the repository at this point in the history
Add integration test for View\Page\Config\Reader\Html (MAGETWO-32720)
  • Loading branch information
vpelipenko committed Jan 15, 2015
2 parents 9685d9c + ffe92e2 commit 7cf9ebf
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?php

namespace Magento\Framework\View\Page\Config\Reader;


class HtmlTest extends \PHPUnit_Framework_TestCase
{
public function testInterpret()
{
/** @var \Magento\Framework\View\Layout\Reader\Context $readerContext */
$readerContext = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->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('<page></page>');

$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());
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd">
<html>
<attribute name="test-name" value="test-value"/>
</html>
</page>

0 comments on commit 7cf9ebf

Please sign in to comment.