/** * Sets up the fixture, for example, open a network connection. * This method is called before a test is executed. * * @return void */ public function setUp() { Zend_Controller_Action_Helper_ContextSwitchTest_LayoutOverride::$_mvcInstance = null; Zend_Controller_Action_HelperBroker::resetHelpers(); $this->front = Zend_Controller_Front::getInstance(); $this->front->resetInstance(); $this->front->addModuleDirectory(dirname(__FILE__) . '/../../_files/modules'); $this->layout = Zend_Layout::startMvc(); $this->helper = new Zend_Controller_Action_Helper_ContextSwitch(); Zend_Controller_Action_HelperBroker::addHelper($this->helper); $this->request = new Zend_Controller_Request_Http(); $this->response = new Zend_Controller_Response_Cli(); $this->front->setRequest($this->request)->setResponse($this->response)->addControllerDirectory(dirname(__FILE__)); $this->view = new Zend_View(); $this->view->addHelperPath(dirname(__FILE__) . '/../../../../../library/Zend/View/Helper/'); $this->viewRenderer = Zend_Controller_Action_HelperBroker::getStaticHelper('viewRenderer'); $this->viewRenderer->setView($this->view); $this->controller = new Zend_Controller_Action_Helper_ContextSwitchTestController($this->request, $this->response, array()); $this->controller->setupContexts(); $this->helper->setActionController($this->controller); }
public static function resetMvcInstance() { self::$_mvcInstance = null; }