Permalink
Browse files

Merge pull request #354 from shama/patch-databasesession-test-fix

Fix DatabaseSessionTest garbage collection test case
  • Loading branch information...
2 parents 69c2750 + 5ee7729 commit 59614b763c9217a1344f6d78c3877c374efc16a8 @ADmad ADmad committed Dec 5, 2011
Showing with 6 additions and 3 deletions.
  1. +6 −3 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 59614b7

Please sign in to comment.