コード例 #1
0
ファイル: LayoutTest.php プロジェクト: opexsw/magento2
 public function testGetChildNames()
 {
     $parentName = 'parent';
     $childrenArray = ['key1' => 'value1', 'key2' => 'value2'];
     $this->structureMock->expects($this->once())->method('getChildren')->with($this->equalTo($parentName))->will($this->returnValue($childrenArray));
     $this->assertSame(['key1', 'key2'], $this->model->getChildNames($parentName));
 }
コード例 #2
0
 /**
  * @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;
 }
コード例 #3
0
 /**
  * {@inheritdoc}
  */
 public function getChildNames($parentName)
 {
     $pluginInfo = $this->pluginList->getNext($this->subjectType, 'getChildNames');
     if (!$pluginInfo) {
         return parent::getChildNames($parentName);
     } else {
         return $this->___callPlugins('getChildNames', func_get_args(), $pluginInfo);
     }
 }