Exemplo n.º 1
0
 public function testSessionRestore()
 {
     $session = UnitTestingSession::singleton();
     $session->TestValue = "abc123";
     $session->storeSession();
     Container::current()->clearSingleton(UnitTestingSession::class);
     $session = UnitTestingSession::singleton();
     $this->assertEquals("abc123", $session->TestValue);
 }
Exemplo n.º 2
0
 public function testSessionGetsProvider()
 {
     Container::current()->registerClass(SessionProvider::class, UnitTestingSessionProvider::class);
     $session = UnitTestingSession::singleton();
     $this->assertInstanceOf(UnitTestingSessionProvider::class, $session->testGetSessionProvider());
     Container::current()->registerClass(SessionProvider::class, PhpSessionProvider::class);
     // Although we have changed the default provider, we already instantiated the session so the provider will not
     // have changed
     $this->assertInstanceOf(UnitTestingSessionProvider::class, $session->testGetSessionProvider());
 }