Exemplo n.º 1
0
 /**
  * Read page layout and write structure to ReadContext
  * @return void
  */
 protected function readPageLayout()
 {
     $pageLayout = $this->getPageLayout();
     if ($pageLayout) {
         $readerContext = $this->layout->getReaderContext();
         $this->pageLayoutReader->read($readerContext, $pageLayout);
     }
 }
Exemplo n.º 2
0
 public function testRead()
 {
     $data = 'test_string';
     $xml = '<body>
                 <attribute name="body_attribute_name" value="body_attribute_value" />
             </body>';
     $this->processorInterface->expects($this->any())->method('load')->with($data)->will($this->returnValue($this->processorInterface));
     $this->themeResolver->expects($this->atLeastOnce())->method('get')->will($this->returnValue($this->themeInterface));
     $createData = ['theme' => $this->themeInterface, 'fileSource' => $this->pageLayoutFileSource, 'cacheSuffix' => 'page_layout'];
     $this->processorFactory->expects($this->once())->method('create')->with($createData)->will($this->returnValue($this->processorInterface));
     $element = new \Magento\Framework\View\Layout\Element($xml);
     $this->processorInterface->expects($this->once())->method('asSimplexml')->will($this->returnValue($element));
     $this->readerPool->expects($this->once())->method('interpret')->with($this->readerContext, $element);
     $this->model->read($this->readerContext, $data);
 }