/** * Sets up the fixture, for example, open a network connection. * This method is called before a test is executed. * * @return void */ public function setUp() { if (isset($_SERVER['HTTP_X_REQUESTED_WITH'])) { unset($_SERVER['HTTP_X_REQUESTED_WITH']); } Zend_Controller_Action_Helper_AjaxContextTest_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_AjaxContext(); $this->request = new Zend_Controller_Request_Http(); $this->response = new Zend_Controller_Response_Cli(); $this->front->setRequest($this->request)->setResponse($this->response); $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_AjaxContextTestController($this->request, $this->response, array()); $this->helper->setActionController($this->controller); }
public static function resetMvcInstance() { self::$_mvcInstance = null; }