Пример #1
0
 /**
  * @covers Mage_Core_Model_Logger::hasLog
  */
 public function testAddStoreLog()
 {
     $store = $this->getMock('Mage_Core_Model_Store', array('getConfig'), array(), '', false);
     $store->expects($this->at(0))->method('getConfig')->with('dev/log/active')->will($this->returnValue(false));
     $store->expects($this->at(1))->method('getConfig')->with('dev/log/active')->will($this->returnValue(true));
     $key = uniqid();
     $this->_model->addStoreLog($key, $store);
     $this->assertFalse($this->_model->hasLog($key));
     $this->_model->addStoreLog($key, $store);
     $this->assertTrue($this->_model->hasLog($key));
 }
Пример #2
0
 /**
  * Build menu model from config
  *
  * @return Mage_Backend_Model_Menu
  * @throws InvalidArgumentException|BadMethodCallException|OutOfRangeException|Exception
  */
 public function getMenu()
 {
     $store = $this->_factory->get('Mage_Core_Model_App')->getStore();
     $this->_logger->addStoreLog(Mage_Backend_Model_Menu::LOGGER_KEY, $store);
     try {
         $this->_initMenu();
         return $this->_menu;
     } catch (InvalidArgumentException $e) {
         $this->_logger->logException($e);
         throw $e;
     } catch (BadMethodCallException $e) {
         $this->_logger->logException($e);
         throw $e;
     } catch (OutOfRangeException $e) {
         $this->_logger->logException($e);
         throw $e;
     } catch (Exception $e) {
         throw $e;
     }
 }