public function PdoSessionHandlerTest::testSessionDestroy

File

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

Class

PdoSessionHandlerTest

Namespace

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

Code

public function testSessionDestroy() {
  $storage = new PdoSessionHandler($this->pdo, array(
    'db_table' => 'sessions',
  ), array());
  $storage
    ->write('foo', 'bar');
  $this
    ->assertEquals(1, count($this->pdo
    ->query('SELECT * FROM sessions')
    ->fetchAll()));
  $storage
    ->destroy('foo');
  $this
    ->assertEquals(0, count($this->pdo
    ->query('SELECT * FROM sessions')
    ->fetchAll()));
}