class NullSessionStorageTest

Test class for NullSessionHandler.

@author Drak <drak@zikula.org>

@runTestsInSeparateProcesses

Hierarchy

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

Expanded class hierarchy of NullSessionStorageTest

File

drupal/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/NullSessionHandlerTest.php, line 25

Namespace

Symfony\Component\HttpFoundation\Tests\Session\Storage\Handler
View source
class NullSessionStorageTest 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