/** * @expectedException OutOfRangeException */ public function testGetResultSkipItemsWithInvalidParent() { $item1 = $this->getMock("Mage_Backend_Model_Menu_Item", array(), array(), '', false); $this->_factoryMock->expects($this->any())->method('createFromArray')->will($this->returnValue($item1)); $this->_model->processCommand(new Mage_Backend_Model_Menu_Builder_Command_Add(array('id' => 'item1', 'parent' => 'not_exists', 'title' => 'Item 1', 'module' => 'Mage_Backend', 'resource' => 'Mage_Backend::item1'))); $this->_model->getResult(); }
/** * * @param Mage_Backend_Model_Menu_Builder $builder * @throws InvalidArgumentException if invalid builder object * @return Mage_Backend_Model_Menu_DirectorAbstract */ public function buildMenu(Mage_Backend_Model_Menu_Builder $builder) { foreach ($this->getExtractedData() as $data) { $command = $this->_getCommand($data); $builder->processCommand($command); } return $this; }