當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Layout::resetMvcInstance方法代碼示例

本文整理匯總了PHP中Zend\Layout\Layout::resetMvcInstance方法的典型用法代碼示例。如果您正苦於以下問題:PHP Layout::resetMvcInstance方法的具體用法?PHP Layout::resetMvcInstance怎麽用?PHP Layout::resetMvcInstance使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Zend\Layout\Layout的用法示例。


在下文中一共展示了Layout::resetMvcInstance方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: setUp

    /**
     * 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\Layout\Layout::resetMvcInstance();

        $this->front = Controller\Front::getInstance();
        $this->front->resetInstance();
        $this->front->addModuleDirectory(__DIR__ . '/../../_files/modules');
        $this->broker = $this->front->getHelperBroker();

        $this->layout = Layout\Layout::startMvc();

        $this->helper = new Helper\ContextSwitch();
        $this->broker->register('contextswitch', $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(__DIR__);

        $this->view = new \Zend\View\PhpRenderer();
        $this->viewRenderer = $this->broker->load('viewRenderer');
        $this->viewRenderer->setView($this->view);

        $this->controller = new ContextSwitchTestController(
            $this->request,
            $this->response,
            array()
        );
        $this->controller->setHelperBroker($this->broker);
        $this->controller->setupContexts();
        $this->helper->setActionController($this->controller);
    }
開發者ID:niallmccrudden,項目名稱:zf2,代碼行數:40,代碼來源:ContextSwitchTest.php

示例2: setUp

 /**
  * 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\Layout\Layout::resetMvcInstance();
     $this->response = new \Zend\Controller\Response\Http();
     $this->response->headersSentThrowsException = false;
     $front = \Zend\Controller\Front::getInstance();
     $front->resetInstance();
     $front->setResponse($this->response);
     $this->helper = new \Zend\View\Helper\Json();
 }
開發者ID:alab1001101,項目名稱:zf2,代碼行數:16,代碼來源:JSONTest.php

示例3: setUp

 public function setUp()
 {
     \Zend\Layout\Layout::resetMvcInstance();
     \Zend\Controller\Front::getInstance()->resetInstance();
     if (HelperBroker::hasHelper('Layout')) {
         HelperBroker::removeHelper('Layout');
     }
     if (HelperBroker::hasHelper('viewRenderer')) {
         HelperBroker::removeHelper('viewRenderer');
     }
 }
開發者ID:heiglandreas,項目名稱:zf2,代碼行數:11,代碼來源:HelperTest.php

示例4: setUp

 /**
  * Sets up the fixture, for example, open a network connection.
  * This method is called before a test is executed.
  *
  * @return void
  */
 public function setUp()
 {
     Layout::resetMvcInstance();
     $this->request = new HTTPRequest();
     $this->response = new CLIResponse();
     $this->front = FrontController::getInstance();
     $this->front->resetInstance();
     $this->front->setRequest($this->request)->setResponse($this->response);
     $this->broker = $this->front->getHelperBroker();
     $this->viewRenderer = $this->broker->load('viewRenderer');
     $this->layout = Layout::startMvc();
 }
開發者ID:rexmac,項目名稱:zf2,代碼行數:18,代碼來源:AutoCompleteTest.php

示例5: setUp

 public function setUp()
 {
     \Zend\Layout\Layout::resetMvcInstance();
     $front = FrontController::getInstance();
     $front->resetInstance();
     $broker = $front->getHelperBroker();
     if ($broker->hasPlugin('Layout')) {
         $broker->unregister('Layout');
     }
     if ($broker->hasPlugin('viewRenderer')) {
         $broker->unregister('viewRenderer');
     }
 }
開發者ID:rexmac,項目名稱:zf2,代碼行數:13,代碼來源:HelperTest.php

示例6: setUp

 /**
  * Sets up the fixture, for example, open a network connection.
  * This method is called before a test is executed.
  *
  * @return void
  */
 public function setUp()
 {
     Layout::resetMvcInstance();
     HelperBroker::resetHelpers();
     HelperBroker::setPluginLoader(null);
     $this->request = new HTTPRequest();
     $this->response = new CLIResponse();
     $this->front = FrontController::getInstance();
     $this->front->resetInstance();
     $this->front->setRequest($this->request)->setResponse($this->response);
     $this->viewRenderer = HelperBroker::getStaticHelper('viewRenderer');
     $this->layout = Layout::startMvc();
 }
開發者ID:heiglandreas,項目名稱:zf2,代碼行數:19,代碼來源:AutoCompleteTest.php

示例7: setUp

 /**
  * 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\Layout\Layout::resetMvcInstance();
     $this->response = new \Zend\Controller\Response\HTTP();
     $this->response->headersSentThrowsException = false;
     $front = \Zend\Controller\Front::getInstance();
     $front->resetInstance();
     $front->setResponse($this->response);
     $this->viewRenderer = new \Zend\Controller\Action\Helper\ViewRenderer();
     \Zend\Controller\Action\HelperBroker\HelperBroker::addHelper($this->viewRenderer);
     $this->helper = new \Zend\Controller\Action\Helper\JSON();
     $this->helper->suppressExit = true;
 }
開發者ID:stunti,項目名稱:zf2,代碼行數:19,代碼來源:JsonTest.php

示例8: setUp

 /**
  * Sets up the fixture, for example, open a network connection.
  * This method is called before a test is executed.
  *
  * @return void
  */
 public function setUp()
 {
     $this->markTestSkipped('Skipped until DOJO is converted to Zend\\Dojo');
     \Zend\Layout\Layout::resetMvcInstance();
     HelperBroker\HelperBroker::resetHelpers();
     HelperBroker\HelperBroker::setPluginLoader(null);
     $this->request = new \Zend\Controller\Request\HTTP();
     $this->response = new \Zend\Controller\Response\Cli();
     $this->front = \Zend\Controller\Front::getInstance();
     $this->front->resetInstance();
     $this->front->setRequest($this->request)->setResponse($this->response);
     $this->viewRenderer = HelperBroker\HelperBroker::getStaticHelper('viewRenderer');
     $this->layout = Layout\Layout::startMvc();
 }
開發者ID:stunti,項目名稱:zf2,代碼行數:20,代碼來源:AutoCompleteTest.php

示例9: setUp

 /**
  * 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\Layout\Layout::resetMvcInstance();
     $this->response = new \Zend\Controller\Response\Http();
     $this->response->headersSentThrowsException = false;
     $front = FrontController::getInstance();
     $front->resetInstance();
     $front->setResponse($this->response);
     $broker = $front->getHelperBroker();
     $this->viewRenderer = new \Zend\Controller\Action\Helper\ViewRenderer();
     $broker->register('viewrenderer', $this->viewRenderer);
     $this->helper = new \Zend\Controller\Action\Helper\Json();
     $this->helper->setBroker($broker);
     $this->helper->suppressExit = true;
 }
開發者ID:bradley-holt,項目名稱:zf2,代碼行數:21,代碼來源:JsonTest.php

示例10: setUp

 /**
  * 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\Layout\Layout::resetMvcInstance();
     HelperBroker\HelperBroker::resetHelpers();
     $this->front = Controller\Front::getInstance();
     $this->front->resetInstance();
     $this->front->addModuleDirectory(dirname(__FILE__) . '/../../_files/modules');
     $this->layout = Layout\Layout::startMvc();
     $this->helper = new Helper\ContextSwitch();
     HelperBroker\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\View();
     $this->viewRenderer = HelperBroker\HelperBroker::getStaticHelper('viewRenderer');
     $this->viewRenderer->setView($this->view);
     $this->controller = new ContextSwitchTestController($this->request, $this->response, array());
     $this->controller->setupContexts();
     $this->helper->setActionController($this->controller);
 }
開發者ID:stunti,項目名稱:zf2,代碼行數:26,代碼來源:ContextSwitchTest.php

示例11: setUp

 /**
  * 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\Layout\Layout::resetMvcInstance();
     HelperBroker\HelperBroker::resetHelpers();
     HelperBroker\HelperBroker::addPrefix('Zend\\Controller\\Action\\Helper');
     $this->front = \Zend\Controller\Front::getInstance();
     $this->front->resetInstance();
     $this->front->addModuleDirectory(dirname(__FILE__) . '/../../_files/modules');
     $this->layout = Layout\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\View();
     $this->view->addHelperPath(dirname(__FILE__) . '/../../../../../library/Zend/View/Helper/');
     $this->viewRenderer = HelperBroker\HelperBroker::getStaticHelper('viewRenderer');
     $this->viewRenderer->setView($this->view);
     $this->controller = new AjaxContextTestController($this->request, $this->response, array());
     $this->helper->setActionController($this->controller);
 }
開發者ID:stunti,項目名稱:zf2,代碼行數:29,代碼來源:AjaxContextTest.php

示例12: testResettingMvcInstanceRemovesMvcSingleton

 public function testResettingMvcInstanceRemovesMvcSingleton()
 {
     $this->testGetMvcInstanceReturnsLayoutInstanceWhenStartMvcHasBeenCalled();
     Layout\Layout::resetMvcInstance();
     $this->assertNull(Layout\Layout::getMvcInstance());
 }
開發者ID:rexmac,項目名稱:zf2,代碼行數:6,代碼來源:LayoutTest.php

示例13: tearDown

 /**
  * Tears down the fixture, for example, close a network connection.
  * This method is called after a test is executed.
  *
  * @return void
  */
 public function tearDown()
 {
     Layout\Layout::resetMvcInstance();
 }
開發者ID:necrogami,項目名稱:zf2,代碼行數:10,代碼來源:PluginTest.php

示例14: reset

 /**
  * Reset MVC state
  *
  * Creates new request/response objects, resets the front controller
  * instance, and resets the action helper broker.
  *
  * @todo   Need to update Zend_Layout to add a resetInstance() method
  * @return void
  */
 public function reset()
 {
     $_SESSION = array();
     $_GET = array();
     $_POST = array();
     $_COOKIE = array();
     $this->resetRequest();
     $this->resetResponse();
     \Zend\Layout\Layout::resetMvcInstance();
     HelperBroker::resetHelpers();
     $this->frontController->resetInstance();
     //\Zend\Session\Manager::$_unitTestEnabled = true;
 }
開發者ID:heiglandreas,項目名稱:zf2,代碼行數:22,代碼來源:ControllerTestCase.php

示例15: reset

 /**
  * Reset MVC state
  *
  * Creates new request/response objects, resets the front controller
  * instance, and resets the action helper broker.
  *
  * @todo   Need to update Zend_Layout to add a resetInstance() method
  * @return void
  */
 public function reset()
 {
     $_SESSION = array();
     $_GET = array();
     $_POST = array();
     $_COOKIE = array();
     $this->resetRequest();
     $this->resetResponse();
     \Zend\Layout\Layout::resetMvcInstance();
     $this->frontController->resetInstance();
 }
開發者ID:alab1001101,項目名稱:zf2,代碼行數:20,代碼來源:ControllerTestCase.php


注:本文中的Zend\Layout\Layout::resetMvcInstance方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。