You are here

protected function LegacyPdoSessionHandlerTest::setUp in Zircon Profile 8

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

File

vendor/symfony/http-foundation/Tests/Session/Storage/Handler/LegacyPdoSessionHandlerTest.php, line 23

Class

LegacyPdoSessionHandlerTest
@group legacy

Namespace

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

Code

protected function setUp() {
  if (!class_exists('PDO') || !in_array('sqlite', \PDO::getAvailableDrivers())) {
    $this
      ->markTestSkipped('This test requires SQLite support in your environment');
  }
  $this->pdo = new \PDO('sqlite::memory:');
  $this->pdo
    ->setAttribute(\PDO::ATTR_ERRMODE, \PDO::ERRMODE_EXCEPTION);
  $sql = 'CREATE TABLE sessions (sess_id VARCHAR(128) PRIMARY KEY, sess_data TEXT, sess_time INTEGER)';
  $this->pdo
    ->exec($sql);
}