/** * @param mixed $displayValue * @dataProvider renderElementDoNotDisplayDataProvider */ public function testRenderElementDoNotDisplay($displayValue) { $displayValue = 'false'; $name = 'test_container'; $blockHtml = ''; $this->structureMock->expects($this->atLeastOnce())->method('getAttribute')->willReturnMap([[$name, 'display', $displayValue]]); $this->assertEquals($blockHtml, $this->model->renderElement($name, false)); }
public function testUpdateContainerAttributes() { $this->_layout->setXml(simplexml_load_file(__DIR__ . '/_files/layout/container_attributes.xml', 'Magento\\Framework\\View\\Layout\\Element')); $this->_layout->generateElements(); $result = $this->_layout->renderElement('container1', false); $this->assertEquals('<div id="container1-2" class="class12">Test11Test12</div>', $result); $result = $this->_layout->renderElement('container2', false); $this->assertEquals('<div id="container2-2" class="class22">Test21Test22</div>', $result); }
/** * {@inheritdoc} */ public function renderElement($name, $useCache = true) { $pluginInfo = $this->pluginList->getNext($this->subjectType, 'renderElement'); if (!$pluginInfo) { return parent::renderElement($name, $useCache); } else { return $this->___callPlugins('renderElement', func_get_args(), $pluginInfo); } }