当前位置: 首页>>代码示例>>PHP>>正文


PHP Zend_Controller_Front::resetInstance方法代码示例

本文整理汇总了PHP中Zend_Controller_Front::resetInstance方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Controller_Front::resetInstance方法的具体用法?PHP Zend_Controller_Front::resetInstance怎么用?PHP Zend_Controller_Front::resetInstance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Zend_Controller_Front的用法示例。


在下文中一共展示了Zend_Controller_Front::resetInstance方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: setUp

    public function setUp()
    {
        $savePath = ini_get('session.save_path');
        if (strpos($savePath, ';')) {
            $savePath = explode(';', $savePath);
            $savePath = array_pop($savePath);
        }
        if (empty($savePath)) {
            $this->markTestSkipped('Cannot test FlashMessenger due to unavailable session save path');
        }

        if (headers_sent()) {
            $this->markTestSkipped('Cannot test FlashMessenger: cannot start session because headers already sent');
        }
        Zend_Session::start();

        $this->front      = Zend_Controller_Front::getInstance();
        $this->front->resetInstance();
        $this->front->setControllerDirectory(dirname(dirname(dirname(__FILE__))) . DIRECTORY_SEPARATOR . '_files');
        $this->front->returnResponse(true);
        $this->request    = new Zend_Controller_Request_Http();
        $this->request->setControllerName('helper-flash-messenger');
        $this->response   = new Zend_Controller_Response_Cli();
        $this->controller = new HelperFlashMessengerController($this->request, $this->response, array());
        $this->helper     = new Zend_Controller_Action_Helper_FlashMessenger($this->controller);
    }
开发者ID:jorgenils,项目名称:zend-framework,代码行数:26,代码来源:FlashMessengerTest.php

示例2: setUp

 public function setUp()
 {
     $this->front = Zend_Controller_Front::getInstance();
     $this->front->resetInstance();
     $this->front->setParam('noViewRenderer', true)->setParam('noErrorHandler', true)->throwExceptions(true);
     Zend_Controller_Action_HelperBroker::resetHelpers();
     //$viewRenderer = Zend_Controller_Action_HelperBroker::getStaticHelper('viewRenderer');
     //$viewRenderer->setActionController();
 }
开发者ID:sasezaki,项目名称:mirror-zf1-tests,代码行数:9,代码来源:HelperBrokerTest.php

示例3: setUp

 protected function setUp()
 {
     $this->_front = Zend_Controller_Front::getInstance();
     $this->_oldRequest = $this->_front->getRequest();
     $this->_oldRouter = $this->_front->getRouter();
     $this->_front->resetInstance();
     $_SERVER['HTTP_HOST'] = 'foobar.example.com';
     $this->_front->setRequest(new Zend_Controller_Request_Http());
     $this->_front->getRouter()->addDefaultRoutes();
 }
开发者ID:crodriguezn,项目名称:crossfit-milagro,代码行数:10,代码来源:MvcTest.php

示例4: setUp

 /**
  * Sets up the fixture, for example, open a network connection.
  * This method is called before a test is executed.
  *
  * @access protected
  */
 protected function setUp()
 {
     $this->basePath = realpath(__DIR__ . str_repeat(DIRECTORY_SEPARATOR . '..', 2));
     $this->request = new \Zend\Controller\Request\Http();
     $this->response = new \Zend\Controller\Response\Http();
     $this->front = \Zend\Controller\Front::getInstance();
     $this->front->resetInstance();
     $this->front->addModuleDirectory($this->basePath . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . 'modules')->setRequest($this->request)->setResponse($this->response);
     $this->helper = new Helper\ViewRenderer();
     HelperBroker::addHelper($this->helper);
 }
开发者ID:heiglandreas,项目名称:zf2,代码行数:17,代码来源:ViewRendererTest.php

示例5: setUp

 /**
  * Sets up the fixture, for example, open a network connection.
  * This method is called before a test is executed.
  *
  * @access protected
  */
 protected function setUp()
 {
     $this->basePath = realpath(dirname(__FILE__) . str_repeat(DIRECTORY_SEPARATOR . '..', 2));
     $this->request = new Zend_Controller_Request_Http();
     $this->response = new Zend_Controller_Response_Http();
     $this->front = Zend_Controller_Front::getInstance();
     $this->front->resetInstance();
     $this->front->addModuleDirectory($this->basePath . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . 'modules')->setRequest($this->request)->setResponse($this->response);
     $this->helper = new Zend_Controller_Action_Helper_ViewRenderer();
     Zend_Controller_Action_HelperBroker::addHelper($this->helper);
 }
开发者ID:jorgenils,项目名称:zend-framework,代码行数:17,代码来源:ViewRendererTest.php

示例6: testDirectProxiesToActionToStack

 public function testDirectProxiesToActionToStack()
 {
     $helper = new Helper\ActionStack();
     /** FC should be reseted to test ActionStack with a really blank FC */
     $this->front->resetInstance();
     try {
         $helper->direct('baz', 'bar', 'foo');
         $this->fail('Zend_Controller_Action_Exception should be thrown');
     } catch (\Zend\Controller\Exception $e) {
         $this->assertInstanceOf('Zend\\Controller\\Action\\Exception', $e, 'Zend\\Controller\\Action\\Exception expected, ' . get_class($e) . ' caught');
     }
 }
开发者ID:bradley-holt,项目名称:zf2,代码行数:12,代码来源:ActionStackTest.php


注:本文中的Zend_Controller_Front::resetInstance方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。