Skip to content
Permalink
Browse files

Adding a test case for DatabaseSession::gc();

  • Loading branch information...
markstory committed Jul 25, 2010
1 parent 28b9ed7 commit eb30c125608c70c311ddee26921d1183dc1ed68d
Showing with 14 additions and 0 deletions.
  1. +14 −0 cake/tests/cases/libs/session/database_session.test.php
@@ -121,4 +121,18 @@ function testDestroy() {
$this->assertTrue(DatabaseSession::destroy('foo'), 'Destroy failed');
$this->assertFalse(DatabaseSession::read('foo'), 'Value still present.');
}
/**
* test the garbage collector
*
* @return void
*/
function testGc() {
Configure::write('Session.timeout', 0);
DatabaseSession::write('foo', 'Some value');
sleep(1);
DatabaseSession::gc();
$this->assertFalse(DatabaseSession::read('foo'));
}
}

0 comments on commit eb30c12

Please sign in to comment.
You can’t perform that action at this time.