add TTL tests for OC_Cache

This commit is contained in:
Robin Appelman 2012-06-05 20:59:52 +02:00
parent f6298cb74f
commit 86ddf386d9
1 changed files with 9 additions and 0 deletions

View File

@ -43,5 +43,14 @@ abstract class Test_Cache extends UnitTestCase {
} }
function testTTL(){ function testTTL(){
$value='foobar';
$this->instance->set('value1',$value,1);
$value2='foobar';
$this->instance->set('value2',$value2);
sleep(2);
$this->assertFalse($this->instance->hasKey('value1'));
$this->assertNull($this->instance->get('value1'));
$this->assertTrue($this->instance->hasKey('value2'));
$this->assertEqual($value2,$this->instance->get('value2'));
} }
} }