本文整理匯總了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);
}
示例2: setUp
public function setUp()
{
StaticEventManager::resetInstance();
if (isset($this->message)) {
unset($this->message);
}
$this->events = new EventManager();
}
示例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();
}
示例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);
}
示例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);
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
示例10: testDoesNotCreateStaticInstanceIfNonePresent
public function testDoesNotCreateStaticInstanceIfNonePresent()
{
StaticEventManager::resetInstance();
$this->assertFalse($this->events->getSharedManager());
}
示例11: tearDown
public function tearDown()
{
StaticEventManager::resetInstance();
}
示例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;
}
示例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;
}
示例14: setUp
public function setUp()
{
StaticEventManager::resetInstance();
}
示例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;
}