Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Fix DatabaseSessionTest garbage collection test case #354

Merged
merged 1 commit into from

2 participants

@shama

Since Session.timeout is only set in the constructor of the DatabaseSession the timeout needed to be set before the class was instantiated to be tested correctly.

@ADmad ADmad merged commit a062135 into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Dec 4, 2011
  1. @shama
This page is out of date. Refresh to see the latest.
View
9 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'));
}
}
Something went wrong with that request. Please try again.