You are here

public function PdoSessionHandlerTest::testWithLazyDsnConnection in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/symfony/http-foundation/Tests/Session/Storage/Handler/PdoSessionHandlerTest.php \Symfony\Component\HttpFoundation\Tests\Session\Storage\Handler\PdoSessionHandlerTest::testWithLazyDsnConnection()

File

vendor/symfony/http-foundation/Tests/Session/Storage/Handler/PdoSessionHandlerTest.php, line 84

Class

PdoSessionHandlerTest

Namespace

Symfony\Component\HttpFoundation\Tests\Session\Storage\Handler

Code

public function testWithLazyDsnConnection() {
  $dsn = $this
    ->getPersistentSqliteDsn();
  $storage = new PdoSessionHandler($dsn);
  $storage
    ->createTable();
  $storage
    ->open('', 'sid');
  $data = $storage
    ->read('id');
  $storage
    ->write('id', 'data');
  $storage
    ->close();
  $this
    ->assertSame('', $data, 'New session returns empty string data');
  $storage
    ->open('', 'sid');
  $data = $storage
    ->read('id');
  $storage
    ->close();
  $this
    ->assertSame('data', $data, 'Written value can be read back correctly');
}