/** * Insert debugging hints into the rendered block contents * * {@inheritdoc} */ public function render(\Magento\Framework\View\Element\BlockInterface $block, $templateFile, array $dictionary = array()) { $result = $this->_subject->render($block, $templateFile, $dictionary); if ($this->_showBlockHints) { $result = $this->_renderBlockHints($result, $block); } $result = $this->_renderTemplateHints($result, $templateFile); return $result; }
public function testSetTemplateContext() { $template = 'themedir/template.phtml'; $context = new \Magento\Framework\DataObject(); $this->_validator->expects($this->once())->method('isValid')->with($template)->will($this->returnValue(true)); $this->_templateEngine->expects($this->once())->method('render')->with($context); $this->_block->setTemplateContext($context); $this->_block->fetchView($template); }
/** * Insert debugging hints into the rendered block contents * * {@inheritdoc} */ public function render(BlockInterface $block, $templateFile, array $dictionary = []) { $orgHtml = $this->_subject->render($block, $templateFile, $dictionary); if ($this->_showBlockHints) { $blockHits = $this->_renderBlockHints("", $block); } $templateHits = $this->_renderTemplateHints("", $templateFile); $result = $this->_renderBlockDescription($templateHits, $blockHits, $orgHtml); return $result; }
public function testSetTemplateContext() { $directoryMock = $this->getMock('\\Magento\\Framework\\Filesystem\\Directory\\Read', array(), array(), '', false); $directoryMock->expects($this->any())->method('getRelativePath')->will($this->returnArgument(0)); $this->_filesystem->expects($this->once())->method('getDirectoryRead')->will($this->returnValue($directoryMock)); $this->_filesystem->expects($this->any())->method('getPath')->will($this->returnValue('themedir')); $directoryMock->expects($this->once())->method('isFile')->with('themedir/template.phtml')->will($this->returnValue(true)); $context = new \Magento\Framework\Object(); $this->_templateEngine->expects($this->once())->method('render')->with($context); $this->_block->setTemplateContext($context); $this->_block->fetchView('themedir/template.phtml'); }
/** * Insert debugging hints into the rendered block contents * * {@inheritdoc} */ public function render(\Magento\Framework\View\Element\BlockInterface $block, $templateFile, array $dictionary = []) { $result = $this->_subject->render($block, $templateFile, $dictionary); $result = $this->_renderAdvancedTemplateHints($result, $templateFile, $block); return $result; }