/** * @param bool $hasElement * @param string $attribute * @param bool $result * @dataProvider isContainerDataProvider */ public function testIsContainer($hasElement, $attribute, $result) { $elementName = 'element_name'; $this->structureMock->expects($this->once())->method('hasElement')->with($this->equalTo($elementName))->will($this->returnValue($hasElement)); if ($hasElement) { $this->structureMock->expects($this->once())->method('getAttribute')->with($this->equalTo($elementName), $this->equalTo('type'))->will($this->returnValue($attribute)); } $this->assertSame($result, $this->model->isContainer($elementName)); }
/** * @magentoAppIsolation enabled */ public function testIsContainer() { $block = 'block'; $container = 'container'; $this->_layout->addBlock('Magento\\Framework\\View\\Element\\Text', $block); $this->_layout->addContainer($container, 'Container'); $this->assertFalse($this->_layout->isContainer($block)); $this->assertTrue($this->_layout->isContainer($container)); $this->assertFalse($this->_layout->isContainer('invalid_name')); }
/** * {@inheritdoc} */ public function isContainer($name) { $pluginInfo = $this->pluginList->getNext($this->subjectType, 'isContainer'); if (!$pluginInfo) { return parent::isContainer($name); } else { return $this->___callPlugins('isContainer', func_get_args(), $pluginInfo); } }