Example #1
0
 /**
  * @expectedException \OutOfRangeException
  */
 public function testGetResultSkipItemsWithInvalidParent()
 {
     $item1 = $this->getMock("Magento\\Backend\\Model\\Menu\\Item", [], [], '', false);
     $this->_factoryMock->expects($this->any())->method('create')->will($this->returnValue($item1));
     $this->_model->processCommand(new \Magento\Backend\Model\Menu\Builder\Command\Add(['id' => 'item1', 'parent' => 'not_exists', 'title' => 'Item 1', 'module' => 'Magento_Backend', 'resource' => 'Magento_Backend::item1']));
     $this->_model->getResult($this->_menuMock);
 }
Example #2
0
 /**
  * Build menu instance
  *
  * @param array $config
  * @param \Magento\Backend\Model\Menu\Builder $builder
  * @param \Psr\Log\LoggerInterface $logger
  * @return void
  */
 public function direct(array $config, \Magento\Backend\Model\Menu\Builder $builder, \Psr\Log\LoggerInterface $logger)
 {
     foreach ($config as $data) {
         $builder->processCommand($this->_getCommand($data, $logger));
     }
 }