diff options
author | Robin Appelman <icewind@owncloud.com> | 2012-06-05 20:59:52 +0200 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2012-06-05 20:59:52 +0200 |
commit | 86ddf386d981341224bbb64635d140fbfe6b5c2b (patch) | |
tree | f4bd3a14d612cb77875a94586380a130c0b8c594 /tests | |
parent | f6298cb74fe7485856e2353e371f2923d5d47890 (diff) | |
download | nextcloud-server-86ddf386d981341224bbb64635d140fbfe6b5c2b.tar.gz nextcloud-server-86ddf386d981341224bbb64635d140fbfe6b5c2b.zip |
add TTL tests for OC_Cache
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lib/cache.php | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/lib/cache.php b/tests/lib/cache.php index 23cbd3506eb..fdc39aec184 100644 --- a/tests/lib/cache.php +++ b/tests/lib/cache.php @@ -43,5 +43,14 @@ abstract class Test_Cache extends UnitTestCase { } 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')); } }
\ No newline at end of file |