Exemple #1
0
 public function testReorderReordersItemOnItsLevel()
 {
     $this->_logger->expects($this->any())->method('log');
     $subMenu = new \Magento\Backend\Model\Menu($this->_logger);
     $this->_items['item1']->expects($this->any())->method("hasChildren")->will($this->returnValue(true));
     $this->_items['item1']->expects($this->any())->method("getChildren")->will($this->returnValue($subMenu));
     $this->_model->add($this->_items['item1']);
     $this->_model->add($this->_items['item2'], 'item1', 10);
     $this->_model->add($this->_items['item3'], 'item1', 20);
     $this->_model->reorder('item2', 25);
     $subMenu->reorder('item3', 30);
     $this->assertEquals($this->_items['item2'], $subMenu[25]);
     $this->assertEquals($this->_items['item3'], $subMenu[30]);
 }