You are here

class NullSessionHandlerTest in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/http-foundation/Tests/Session/Storage/Handler/NullSessionHandlerTest.php \Symfony\Component\HttpFoundation\Tests\Session\Storage\Handler\NullSessionHandlerTest

Test class for NullSessionHandler.

@author Drak <drak@zikula.org>

@runTestsInSeparateProcesses @preserveGlobalState disabled

Hierarchy

  • class \Symfony\Component\HttpFoundation\Tests\Session\Storage\Handler\NullSessionHandlerTest extends \Symfony\Component\HttpFoundation\Tests\Session\Storage\Handler\PHPUnit_Framework_TestCase

Expanded class hierarchy of NullSessionHandlerTest

File

vendor/symfony/http-foundation/Tests/Session/Storage/Handler/NullSessionHandlerTest.php, line 26

Namespace

Symfony\Component\HttpFoundation\Tests\Session\Storage\Handler
View source
class NullSessionHandlerTest extends \PHPUnit_Framework_TestCase {
  public function testSaveHandlers() {
    $storage = $this
      ->getStorage();
    $this
      ->assertEquals('user', ini_get('session.save_handler'));
  }
  public function testSession() {
    session_id('nullsessionstorage');
    $storage = $this
      ->getStorage();
    $session = new Session($storage);
    $this
      ->assertNull($session
      ->get('something'));
    $session
      ->set('something', 'unique');
    $this
      ->assertEquals('unique', $session
      ->get('something'));
  }
  public function testNothingIsPersisted() {
    session_id('nullsessionstorage');
    $storage = $this
      ->getStorage();
    $session = new Session($storage);
    $session
      ->start();
    $this
      ->assertEquals('nullsessionstorage', $session
      ->getId());
    $this
      ->assertNull($session
      ->get('something'));
  }
  public function getStorage() {
    return new NativeSessionStorage(array(), new NullSessionHandler());
  }

}

Members