From 66b3e9a7c9968dc6c86acab35efbc589fe772c59 Mon Sep 17 00:00:00 2001 From: Kyle Robinson Young Date: Sun, 4 Dec 2011 13:04:42 -0800 Subject: [PATCH] Fix DatabaseSessionTest garbage collection test case --- .../Model/Datasource/Session/DatabaseSessionTest.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/Cake/Test/Case/Model/Datasource/Session/DatabaseSessionTest.php b/lib/Cake/Test/Case/Model/Datasource/Session/DatabaseSessionTest.php index 7d29a397c..50c9ea4fb 100644 --- a/lib/Cake/Test/Case/Model/Datasource/Session/DatabaseSessionTest.php +++ b/lib/Cake/Test/Case/Model/Datasource/Session/DatabaseSessionTest.php @@ -169,11 +169,14 @@ class DatabaseSessionTest extends CakeTestCase { * @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')); } } \ No newline at end of file