File tree Expand file tree Collapse file tree 2 files changed +31
-0
lines changed
dev/tests/integration/testsuite/Magento/Framework/View/Page/Config/Reader Expand file tree Collapse file tree 2 files changed +31
-0
lines changed Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace Magento \Framework \View \Page \Config \Reader ;
4+
5+
6+ class HtmlTest extends \PHPUnit_Framework_TestCase
7+ {
8+ public function testInterpret ()
9+ {
10+ /** @var \Magento\Framework\View\Layout\Reader\Context $readerContext */
11+ $ readerContext = \Magento \TestFramework \Helper \Bootstrap::getObjectManager ()->create (
12+ 'Magento\Framework\View\Layout\Reader\Context '
13+ );
14+ $ pageXml = new \Magento \Framework \View \Layout \Element (__DIR__ . '/_files/_layout_update.xml ' , 0 , true );
15+ $ parentElement = new \Magento \Framework \View \Layout \Element ('<page></page> ' );
16+
17+ $ html = new Html ();
18+ foreach ($ pageXml ->xpath ('html ' ) as $ htmlElement ) {
19+ $ html ->interpret ($ readerContext , $ htmlElement , $ parentElement );
20+ }
21+
22+ $ structure = $ readerContext ->getPageConfigStructure ();
23+ $ this ->assertEquals (['html ' => ['test-name ' => 'test-value ' ]], $ structure ->getElementAttributes ());
24+ }
25+ }
Original file line number Diff line number Diff line change 1+ <?xml version =" 1.0" ?>
2+ <page xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance" xsi : noNamespaceSchemaLocation =" ../../../../../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd" >
3+ <html >
4+ <attribute name =" test-name" value =" test-value" />
5+ </html >
6+ </page >
You can’t perform that action at this time.
0 commit comments