You are here

public function NativeSessionStorageTest::testSetSaveHandler53 in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/http-foundation/Tests/Session/Storage/NativeSessionStorageTest.php \Symfony\Component\HttpFoundation\Tests\Session\Storage\NativeSessionStorageTest::testSetSaveHandler53()

File

vendor/symfony/http-foundation/Tests/Session/Storage/NativeSessionStorageTest.php, line 179

Class

NativeSessionStorageTest
Test class for NativeSessionStorage.

Namespace

Symfony\Component\HttpFoundation\Tests\Session\Storage

Code

public function testSetSaveHandler53() {
  if (PHP_VERSION_ID >= 50400) {
    $this
      ->markTestSkipped('Test skipped, for PHP 5.3 only.');
  }
  $this
    ->iniSet('session.save_handler', 'files');
  $storage = $this
    ->getStorage();
  $storage
    ->setSaveHandler();
  $this
    ->assertInstanceOf('Symfony\\Component\\HttpFoundation\\Session\\Storage\\Proxy\\NativeProxy', $storage
    ->getSaveHandler());
  $storage
    ->setSaveHandler(null);
  $this
    ->assertInstanceOf('Symfony\\Component\\HttpFoundation\\Session\\Storage\\Proxy\\NativeProxy', $storage
    ->getSaveHandler());
  $storage
    ->setSaveHandler(new NativeSessionHandler());
  $this
    ->assertInstanceOf('Symfony\\Component\\HttpFoundation\\Session\\Storage\\Proxy\\NativeProxy', $storage
    ->getSaveHandler());
  $storage
    ->setSaveHandler(new SessionHandlerProxy(new NullSessionHandler()));
  $this
    ->assertInstanceOf('Symfony\\Component\\HttpFoundation\\Session\\Storage\\Proxy\\SessionHandlerProxy', $storage
    ->getSaveHandler());
  $storage
    ->setSaveHandler(new NullSessionHandler());
  $this
    ->assertInstanceOf('Symfony\\Component\\HttpFoundation\\Session\\Storage\\Proxy\\SessionHandlerProxy', $storage
    ->getSaveHandler());
  $storage
    ->setSaveHandler(new NativeProxy());
  $this
    ->assertInstanceOf('Symfony\\Component\\HttpFoundation\\Session\\Storage\\Proxy\\NativeProxy', $storage
    ->getSaveHandler());
}