function testDestroy() { $this->sessionManager->start(); $repository = $this->sessionManager->getRepository(); $sessionKey = 'hello'; $sessionValue = 'world'; $repository[$sessionKey] = $sessionValue; $this->assertEquals($sessionValue, $repository->get($sessionKey)); $this->sessionManager->destroy(); $this->assertEquals(null, $repository->get($sessionKey)); }
/** * SessionManager初始化工作 * @param SessionManager $sessionManager */ function initialize(SessionManager $sessionManager) { $this->duration = $sessionManager->getGcMaxLifeTime(); parent::initialize($sessionManager); }