/** * @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); }