/**
  * {@inheritdoc}
  */
 public function getHandles()
 {
     $pluginInfo = $this->pluginList->getNext($this->subjectType, 'getHandles');
     if (!$pluginInfo) {
         return parent::getHandles();
     } else {
         return $this->___callPlugins('getHandles', func_get_args(), $pluginInfo);
     }
 }
Beispiel #2
0
 public function testLoadDbApp()
 {
     $this->assertEmpty($this->model->getHandles());
     $this->assertEmpty($this->model->asString());
     $handles = ['fixture_handle_one', 'fixture_handle_two'];
     $this->model->load($handles);
     $expectedResult = '
         <root>
             <body>
                 <block class="Magento\\Framework\\View\\Element\\Template" template="fixture_template_one.phtml"/>
             </body>
             <body>
                 <block class="Magento\\Framework\\View\\Element\\Template" template="fixture_template_two.phtml"/>
             </body>
         </root>
     ';
     $actualResult = '<root>' . $this->model->asString() . '</root>';
     $this->assertXmlStringEqualsXmlString($expectedResult, $actualResult);
 }
Beispiel #3
0
 /**
  * Test loading invalid layout
  */
 public function testLoadWithInvalidLayout()
 {
     $this->_model->addPageHandles(['default']);
     $this->_appState->expects($this->any())->method('getMode')->will($this->returnValue('developer'));
     $this->_layoutValidator->expects($this->any())->method('getMessages')->will($this->returnValue(['testMessage1', 'testMessage2']));
     $this->_layoutValidator->expects($this->any())->method('isValid')->will($this->returnValue(false));
     $suffix = md5(implode('|', $this->_model->getHandles()));
     $cacheId = "LAYOUT_{$this->_theme->getArea()}_STORE{$this->scope->getId()}_{$this->_theme->getId()}{$suffix}";
     $messages = $this->_layoutValidator->getMessages();
     // Testing error message is logged with logger
     $this->_logger->expects($this->once())->method('info')->with('Cache file with merged layout: ' . $cacheId . ' and handles default' . ': ' . array_shift($messages));
     $this->_model->load();
 }