Permalink
Browse files

Fix DatabaseSessionTest garbage collection test case

  • Loading branch information...
1 parent 1bc3583 commit 66b3e9a7c9968dc6c86acab35efbc589fe772c59 @shama committed Dec 4, 2011
Showing with 6 additions and 3 deletions.
  1. +6 −3 lib/Cake/Test/Case/Model/Datasource/Session/DatabaseSessionTest.php
@@ -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 66b3e9a

Please sign in to comment.