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


PHP StaticEventManager::resetInstance方法代碼示例

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


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

示例1: testCanResetInstance

 public function testCanResetInstance()
 {
     $original = StaticEventManager::getInstance();
     StaticEventManager::resetInstance();
     $test = StaticEventManager::getInstance();
     $this->assertNotSame($original, $test);
 }
開發者ID:rexmac,項目名稱:zf2,代碼行數:7,代碼來源:StaticEventManagerTest.php

示例2: setUp

 public function setUp()
 {
     StaticEventManager::resetInstance();
     if (isset($this->message)) {
         unset($this->message);
     }
     $this->events = new EventManager();
 }
開發者ID:robertodormepoco,項目名稱:zf2,代碼行數:8,代碼來源:EventManagerTest.php

示例3: setUp

 public function setUp()
 {
     $this->controller = new TestAsset\RestfulTestController();
     $this->request = new Request();
     $this->routeMatch = new RouteMatch(array('controller' => 'controller-restful'));
     $this->event = new MvcEvent();
     $this->event->setRouteMatch($this->routeMatch);
     $this->controller->setEvent($this->event);
     StaticEventManager::resetInstance();
 }
開發者ID:rafalwrzeszcz,項目名稱:zf2,代碼行數:10,代碼來源:RestfulControllerTest.php

示例4: setUp

 public function setUp()
 {
     StaticEventManager::resetInstance();
     $this->controller = new TestAsset\SampleController();
     $this->request = new Request();
     $this->response = null;
     $this->routeMatch = new RouteMatch(array('controller' => 'controller-sample'));
     $this->event = new MvcEvent();
     $this->event->setRouteMatch($this->routeMatch);
     $this->controller->setEvent($this->event);
 }
開發者ID:razvansividra,項目名稱:pnlzf2-1,代碼行數:11,代碼來源:ActionControllerTest.php

示例5: setUp

 public function setUp()
 {
     StaticEventManager::resetInstance();
     $this->controller = new IndexController();
     $this->request = new Request();
     $this->response = null;
     $this->routeMatch = new RouteMatch(array('controller' => 'php-unit-controller-index'));
     $this->event = new MvcEvent();
     $this->event->setRouteMatch($this->routeMatch);
     $this->controller->setEvent($this->event);
 }
開發者ID:jordiwes,項目名稱:zf2.unlikelysource.org,代碼行數:11,代碼來源:IndexControllerTest.php

示例6: _after

 public function _after(\Codeception\TestCase $test)
 {
     $_SESSION = array();
     $_GET = array();
     $_POST = array();
     $_COOKIE = array();
     // reset singleton
     StaticEventManager::resetInstance();
     Placeholder\Registry::unsetRegistry();
     $this->queries = 0;
     $this->time = 0;
 }
開發者ID:NaszvadiG,項目名稱:ImageCMS,代碼行數:12,代碼來源:ZF2.php

示例7: _after

 public function _after(\Codeception\TestCase $test)
 {
     $_SESSION = array();
     $_GET = array();
     $_POST = array();
     $_COOKIE = array();
     // reset singleton
     StaticEventManager::resetInstance();
     // Reset singleton placeholder if version < 2.2.0, no longer required in 2.2.0+
     if (Version::compareVersion('2.2.0') >= 0) {
         Placeholder\Registry::unsetRegistry();
     }
     $this->queries = 0;
     $this->time = 0;
 }
開發者ID:Eli-TW,項目名稱:Codeception,代碼行數:15,代碼來源:ZF2.php

示例8: _after

 public function _after(\Codeception\TestCase $test)
 {
     $_SESSION = [];
     $_GET = [];
     $_POST = [];
     $_COOKIE = [];
     // reset singleton
     StaticEventManager::resetInstance();
     // Reset singleton placeholder if version < 2.2.0, no longer required in 2.2.0+
     if (Version::compareVersion('2.2.0') >= 0) {
         Placeholder\Registry::unsetRegistry();
     }
     //Close the session, if any are open
     if (session_status() == PHP_SESSION_ACTIVE) {
         session_write_close();
     }
     $this->queries = 0;
     $this->time = 0;
 }
開發者ID:namnv609,項目名稱:Codeception,代碼行數:19,代碼來源:ZF2.php

示例9: setUp

 protected function setUp()
 {
     StaticEventManager::resetInstance();
     $this->serviceManager = new ServiceManager();
     $this->request = new Request();
     $this->routeMatch = new RouteMatch(array('controller' => 'HtUserRegistration'));
     $this->event = new MvcEvent();
     $this->event->setRouteMatch($this->routeMatch);
     $this->zfcUserMapper = $this->getMock('ZfcUser\\Mapper\\User');
     $this->zfcUserEntity = $this->getMock('ZfcUser\\Entity\\UserInterface');
     $this->userRegistrationService = $this->getMock('HtUserRegistration\\Service\\UserRegistrationServiceInterface');
     $this->userRegistrationMapper = $this->getMock('HtUserRegistration\\Mapper\\UserRegistrationMapperInterface');
     $this->userRegistrationEntity = $this->getMock('HtUserRegistration\\Entity\\UserRegistrationInterface');
     $this->moduleOptions = $this->getMock('HtUserRegistration\\Options\\ModuleOptions');
     $this->moduleOptions->expects($this->any())->method('getPostVerificationRoute')->willReturn($this->redirectRoute);
     $routeStack = new SimpleRouteStack();
     $route = new Segment($this->redirectRoute);
     $routeStack->addRoute($this->redirectRoute, $route);
     $this->event->setRouter($routeStack);
     $this->serviceManager->setService('HtUserRegistration\\ModuleOptions', $this->moduleOptions);
     $this->controller = new UserRegistrationController($this->userRegistrationService);
     $this->controller->setServiceLocator($this->serviceManager);
     $this->controller->setEvent($this->event);
 }
開發者ID:Ellipizle,項目名稱:HtUserRegistration,代碼行數:24,代碼來源:UserRegistrationControllerTest.php

示例10: testDoesNotCreateStaticInstanceIfNonePresent

 public function testDoesNotCreateStaticInstanceIfNonePresent()
 {
     StaticEventManager::resetInstance();
     $this->assertFalse($this->events->getSharedManager());
 }
開發者ID:pnaq57,項目名稱:zf2demo,代碼行數:5,代碼來源:EventManagerTest.php

示例11: tearDown

 public function tearDown()
 {
     StaticEventManager::resetInstance();
 }
開發者ID:benivaldo,項目名稱:zf2-na-pratica,代碼行數:4,代碼來源:ForwardTest.php

示例12: array

<?php

include_once __DIR__ . '/vendor/autoload.php';
$appConfig = $appConfig = array('modules' => array(), 'module_listener_options' => array('module_paths' => array('./vendor'), 'config_glob_paths' => array('config/autoload/{,*.}{global,local}.php')));
if (!is_dir(__DIR__ . '/trace')) {
    mkdir(__DIR__ . '/trace');
}
ini_set('xdebug.show_mem_delta', '1');
for ($t = 0; $t < 5; $t++) {
    xdebug_start_trace(sprintf('%s/trace/%d', __DIR__, $t + 1));
    $app = \Zend\Mvc\Application::init($appConfig);
    xdebug_stop_trace();
    \Zend\EventManager\StaticEventManager::resetInstance();
    $app = null;
}
開發者ID:akomm,項目名稱:zf2-memory-leak-test,代碼行數:15,代碼來源:test3.php

示例13: reset

 /**
  * Reset the request
  *
  * @return AbstractControllerTestCase
  */
 public function reset($keepPersistence = false)
 {
     // force to re-create all components
     $this->application = null;
     // reset server datas
     if (!$keepPersistence) {
         $_SESSION = [];
         $_COOKIE = [];
     }
     $_GET = [];
     $_POST = [];
     // reset singleton
     StaticEventManager::resetInstance();
     return $this;
 }
開發者ID:CHRISTOPHERVANDOMME,項目名稱:zf2complet,代碼行數:20,代碼來源:AbstractControllerTestCase.php

示例14: setUp

 public function setUp()
 {
     StaticEventManager::resetInstance();
 }
開發者ID:navassouza,項目名稱:zf2,代碼行數:4,代碼來源:StaticIntegrationTest.php

示例15: reset

 /**
  * Reset the request
  *
  * @return AbstractControllerTestCase
  */
 public function reset()
 {
     // force to re-create all components
     $this->application = null;
     // reset server datas
     $_SESSION = array();
     $_GET = array();
     $_POST = array();
     $_COOKIE = array();
     // reset singleton
     StaticEventManager::resetInstance();
     return $this;
 }
開發者ID:killturinG,項目名稱:zf2,代碼行數:18,代碼來源:AbstractControllerTestCase.php


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