mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 09:06:17 +00:00
Adding a test case for DatabaseSession::gc();
This commit is contained in:
parent
28b9ed7264
commit
eb30c12560
1 changed files with 14 additions and 0 deletions
|
@ -121,4 +121,18 @@ class DatabaseSessionTest extends CakeTestCase {
|
|||
$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'));
|
||||
}
|
||||
}
|
Loading…
Add table
Reference in a new issue