public function testGetRememberUserDuration()
 {
     $config = $this->getConfig();
     $provider = new CookieSessionProvider(['priority' => 10]);
     $provider->setLogger(new \Psr\Log\NullLogger());
     $provider->setConfig($config);
     $provider->setManager(SessionManager::singleton());
     $this->assertSame(200, $provider->getRememberUserDuration());
     $config->set('ExtendedLoginCookieExpiration', null);
     $this->assertSame(100, $provider->getRememberUserDuration());
     $config->set('ExtendedLoginCookieExpiration', 0);
     $this->assertSame(null, $provider->getRememberUserDuration());
 }
Ejemplo n.º 2
0
 public function testUnpersistSession()
 {
     $provider = new CookieSessionProvider(array('priority' => 1, 'sessionName' => 'MySessionName', 'cookieOptions' => array('prefix' => 'x')));
     $provider->setLogger(new \Psr\Log\NullLogger());
     $provider->setConfig($this->getConfig());
     $provider->setManager(SessionManager::singleton());
     $request = new \FauxRequest();
     $provider->unpersistSession($request);
     $this->assertSame('', $request->response()->getCookie('MySessionName'));
     $this->assertSame('', $request->response()->getCookie('xUserID'));
     $this->assertSame(null, $request->response()->getCookie('xUserName'));
     $this->assertSame('', $request->response()->getCookie('xToken'));
     $this->assertSame('', $request->response()->getCookie('forceHTTPS'));
     $provider->unpersistSession($this->getSentRequest());
 }