Skip to content

Commit

Permalink
Merge pull request cakephp#354 from shama/patch-databasesession-test-fix
Browse files Browse the repository at this point in the history
Fix DatabaseSessionTest garbage collection test case
  • Loading branch information
ADmad committed Dec 5, 2011
2 parents 69c2750 + 5ee7729 commit 59614b7
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -169,11 +169,14 @@ public function testDestroy() {
* @return void
*/
public function testGc() {
ClassRegistry::flush();
Configure::write('Session.timeout', 0);
$this->storage->write('foo', 'Some value');

$storage = new DatabaseSession();
$storage->write('foo', 'Some value');

sleep(1);
$this->storage->gc();
$this->assertFalse($this->storage->read('foo'));
$storage->gc();
$this->assertFalse($storage->read('foo'));
}
}

0 comments on commit 59614b7

Please sign in to comment.