public function testSetChild() { $elementName = 'child'; $parentName = 'parent'; $alias = 'some_alias'; $this->structureMock->expects($this->once())->method('setAsChild')->with($this->equalTo($elementName), $this->equalTo($parentName), $this->equalTo($alias))->will($this->returnSelf()); $this->assertSame($this->model, $this->model->setChild($parentName, $elementName, $alias)); }
/** * @return \Magento\Framework\View\Layout */ public function testSetChild() { $this->_layout->addContainer('one', 'One'); $this->_layout->addContainer('two', 'Two'); $this->_layout->addContainer('three', 'Three'); $this->assertSame($this->_layout, $this->_layout->setChild('one', 'two', '')); $this->_layout->setChild('one', 'three', 'three_alias'); $this->assertSame(['two', 'three'], $this->_layout->getChildNames('one')); return $this->_layout; }
/** * {@inheritdoc} */ public function setChild($parentName, $elementName, $alias) { $pluginInfo = $this->pluginList->getNext($this->subjectType, 'setChild'); if (!$pluginInfo) { return parent::setChild($parentName, $elementName, $alias); } else { return $this->___callPlugins('setChild', func_get_args(), $pluginInfo); } }