Beispiel #1
0
 /**
  * Test merged menu configuration
  */
 public function testMergedConfig()
 {
     try {
         $this->_model->validate();
     } catch (Magento_Exception $e) {
         $this->fail($e->getMessage());
     }
 }
Beispiel #2
0
 /**
  * Test validation of valid files
  */
 public function testValidateValidConfig()
 {
     $basePath = realpath(__DIR__) . '/../../_files/';
     $files = array($basePath . 'menu_1.xml', $basePath . 'menu_2.xml');
     $model = new Mage_Backend_Model_Menu_Config_Menu($files);
     try {
         $this->assertInstanceOf('Mage_Backend_Model_Menu_Config_Menu', $model->validate());
     } catch (Magento_Exception $e) {
         $this->fail($e->getMessage());
     }
 }
Beispiel #3
0
 public function testGetMenuGenericExceptionIsNotLogged()
 {
     $this->_configMenuMock->expects($this->any())->method('getMergedConfig')->will($this->returnValue($this->_domDocumentMock));
     $this->_logger->expects($this->never())->method('logException');
     $this->_menuBuilderMock->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");
 }
 /**
  * Test merged menu configuration
  */
 public function testMergedConfig()
 {
     $model = new Mage_Backend_Model_Menu_Config_Menu($this->_getConfigurationFileList());
     try {
         $this->assertInstanceOf('Mage_Backend_Model_Menu_Config_Menu', $model->validate());
     } catch (Magento_Exception $e) {
         $this->fail($e->getMessage());
     }
 }