You are here

public function LegacyPdoSessionHandlerTest::testWrongPdoErrMode 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::testWrongPdoErrMode()

File

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

Class

LegacyPdoSessionHandlerTest
@group legacy

Namespace

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

Code

public function testWrongPdoErrMode() {
  $pdo = new \PDO('sqlite::memory:');
  $pdo
    ->setAttribute(\PDO::ATTR_ERRMODE, \PDO::ERRMODE_SILENT);
  $pdo
    ->exec('CREATE TABLE sessions (sess_id VARCHAR(128) PRIMARY KEY, sess_data TEXT, sess_time INTEGER)');
  $this
    ->setExpectedException('InvalidArgumentException');
  $storage = new LegacyPdoSessionHandler($pdo, array(
    'db_table' => 'sessions',
  ));
}