aboutsummaryrefslogtreecommitdiffstats
path: root/tests/lib/files/cache/cache.php
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2012-10-08 14:58:21 +0200
committerRobin Appelman <icewind@owncloud.com>2012-10-08 14:58:21 +0200
commit13515effc99bfad7e776d00476e897fa396a8c6c (patch)
tree4b914a0413b856a5c84ba88d3971f4dc00c75c24 /tests/lib/files/cache/cache.php
parentc815fd5a5c8cba52b24327584e689498cb03fb3e (diff)
downloadnextcloud-server-13515effc99bfad7e776d00476e897fa396a8c6c.tar.gz
nextcloud-server-13515effc99bfad7e776d00476e897fa396a8c6c.zip
add Cache::getStatus
Diffstat (limited to 'tests/lib/files/cache/cache.php')
-rw-r--r--tests/lib/files/cache/cache.php10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/lib/files/cache/cache.php b/tests/lib/files/cache/cache.php
index 8cedadbf19a..177cf1c045d 100644
--- a/tests/lib/files/cache/cache.php
+++ b/tests/lib/files/cache/cache.php
@@ -101,6 +101,16 @@ class Cache extends \UnitTestCase {
}
}
+ function testStatus() {
+ $this->assertEquals(\OC\Files\Cache\Cache::NOT_FOUND, $this->cache->getStatus('foo'));
+ $this->cache->put('foo', array('size' => -1));
+ $this->assertEquals(\OC\Files\Cache\Cache::PARTIAL, $this->cache->getStatus('foo'));
+ $this->cache->put('foo', array('size' => -1, 'mtime' => 20, 'mimetype' => 'foo/file'));
+ $this->assertEquals(\OC\Files\Cache\Cache::SHALLOW, $this->cache->getStatus('foo'));
+ $this->cache->put('foo', array('size' => 10));
+ $this->assertEquals(\OC\Files\Cache\Cache::COMPLETE, $this->cache->getStatus('foo'));
+ }
+
public function tearDown() {
$this->cache->clear();
}