예제 #1
0
 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());
 }
 public function testDesproySession()
 {
     $this->legacySessionTable->write(self::$SESSION_ID, self::$SESSION_DATA);
     $this->assertTrue($this->migrationSession->destroy(self::$SESSION_ID));
     $this->assertEquals(self::$SESSION_DATA_EMPTY, $this->migrationSession->read(self::$SESSION_ID));
 }