示例#1
0
 public function testCreateRouterWithArguments()
 {
     $arguments = array('areaCode' => self::AREA, 'baseController' => self::BASE_CONTROLLER);
     $routerInfo = array('area' => self::AREA, 'base_controller' => self::BASE_CONTROLLER);
     $this->_objectManager->expects($this->once())->method('get')->with(self::CLASS_NAME, $arguments)->will($this->returnValue('TestRouterInstance'));
     $this->assertEquals('TestRouterInstance', $this->_controller->createRouter(self::CLASS_NAME, $routerInfo));
 }
示例#2
0
 public function testUpdateNavigationMode()
 {
     $this->_setAdditionalExpectations();
     $request = $this->getMock('Mage_Core_Controller_Request_Http', array('getParam', 'isAjax', 'getPathInfo'), array(), '', false);
     $controller = $this->getMock('Mage_Adminhtml_Controller_Action', array('getFullActionName'), array(), '', false);
     $request->expects($this->once())->method('getParam')->with('handle', '')->will($this->returnValue(''));
     $request->expects($this->once())->method('isAjax')->will($this->returnValue(false));
     $controller->expects($this->once())->method('getFullActionName')->will($this->returnValue('index'));
     $this->_backendSession->expects($this->at(0))->method('setData')->with('vde_current_handle', 'index');
     $request->expects($this->once())->method('getPathInfo')->will($this->returnValue('/'));
     $this->_backendSession->expects($this->at(1))->method('setData')->with('vde_current_url', '/');
     $this->_backendSession->expects($this->at(2))->method('setData')->with('vde_current_mode', Mage_DesignEditor_Model_State::MODE_NAVIGATION);
     $this->_urlModelFactory->expects($this->once())->method('replaceClassName')->with(self::URL_MODEL_NAVIGATION_MODE_CLASS_NAME);
     $this->_layoutFactory->expects($this->once())->method('createLayout')->with(array('area' => self::AREA_CODE), self::LAYOUT_NAVIGATION_CLASS_NAME);
     $this->_objectManager->expects($this->once())->method('addAlias')->with(self::LAYOUT_UPDATE_RESOURCE_MODEL_CORE_CLASS_NAME, self::LAYOUT_UPDATE_RESOURCE_MODEL_VDE_CLASS_NAME);
     $this->_model->update(self::AREA_CODE, $request, $controller);
 }
示例#3
0
 public function testCreateController()
 {
     $this->_objectManager->expects($this->once())->method('create')->with(self::CONTROLLER_NAME, array())->will($this->returnValue('TestControllerInstance'));
     $this->_model = new Mage_Core_Controller_Varien_Action_Factory($this->_objectManager);
     $this->assertEquals('TestControllerInstance', $this->_model->createController(self::CONTROLLER_NAME));
 }