Ejemplo n.º 1
0
 public function testGetMenuGenericExceptionIsNotLogged()
 {
     $this->_configMenuMock->expects($this->any())->method('getMergedConfig')->will($this->returnValue($this->_domDocumentMock));
     $this->_logger->expects($this->never())->method('logException');
     $this->_builderMock->expects($this->exactly(1))->method('getResult')->will($this->throwException(new Exception()));
     try {
         $this->_model->getMenu();
     } catch (Exception $e) {
         return;
     }
     $this->fail("Generic Exception was not throwed");
 }
Ejemplo n.º 2
0
 public function setUp()
 {
     $this->_appConfigMock = $this->getMock('Mage_Core_Model_Config', array(), array(), '', false);
     $this->_appConfigMock->expects($this->any())->method('getModelInstance')->will($this->returnCallback(array($this, 'getModelInstance')));
     $this->_cacheInstanceMock = $this->getMock('Mage_Core_Model_Cache', array(), array(), '', false);
     $this->_directorDomMock = $this->getMock('Mage_Backend_Model_Menu_Director_Dom', array(), array(), '', false);
     $this->_menuFactoryMock = $this->getMock('Mage_Backend_Model_Menu_Factory', array(), array(), '', false);
     $this->_configMenuMock = $this->getMock('Mage_Backend_Model_Menu_Config_Menu', array(), array(), '', false);
     $this->_domDocumentMock = $this->getMock('DOMDocument', array(), array(), '', false);
     $this->_eventManagerMock = $this->getMock('Mage_Core_Model_Event_Manager');
     $this->_logger = $this->getMock('Mage_Backend_Model_Menu_Logger');
     $this->_menuMock = $this->getMock('Mage_Backend_Model_Menu', array(), array(), '', false);
     $this->_menuBuilderMock = $this->getMock('Mage_Backend_Model_Menu_Builder', array(), array(), '', false);
     $this->_menuFactoryMock->expects($this->any())->method('getMenuInstance')->will($this->returnValue($this->_menuMock));
     $this->_model = new Mage_Backend_Model_Menu_Config(array('appConfig' => $this->_appConfigMock, 'cache' => $this->_cacheInstanceMock, 'eventManager' => $this->_eventManagerMock, 'menuFactory' => $this->_menuFactoryMock, 'logger' => $this->_logger));
 }