Example #1
0
 public function testLogoutAndRegistry()
 {
     $factory = new Factory();
     $repository = $this->getRepositoryMock();
     $transport = $this->getTransportStub();
     $transport->expects($this->once())->method('logout');
     $session = new Session($factory, $repository, 'x', new SimpleCredentials('foo', 'bar'), $transport);
     $this->assertTrue($session->isLive());
     $key = $session->getRegistryKey();
     $this->assertSame($session, Session::getSessionFromRegistry($key));
     $session->logout();
     $this->assertFalse($session->isLive());
     $this->assertNull(Session::getSessionFromRegistry($key));
 }