You are here

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

File

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

Class

LegacyPdoSessionHandlerTest
@group legacy

Namespace

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

Code

public function testSessionGC() {
  $storage = new LegacyPdoSessionHandler($this->pdo, array(
    'db_table' => 'sessions',
  ));
  $storage
    ->write('foo', 'bar');
  $storage
    ->write('baz', 'bar');
  $this
    ->assertCount(2, $this->pdo
    ->query('SELECT * FROM sessions')
    ->fetchAll());
  $storage
    ->gc(-1);
  $this
    ->assertCount(0, $this->pdo
    ->query('SELECT * FROM sessions')
    ->fetchAll());
}