summaryrefslogtreecommitdiffstats
path: root/tests/lib/files/cache/cache.php
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2012-10-27 17:02:05 +0200
committerRobin Appelman <icewind@owncloud.com>2012-10-27 18:08:00 +0200
commit56e9ce44c3ac18d6183a8959c690c6e3269bc79e (patch)
tree988417bbb4c050db18a359514fc9a6af664de9b1 /tests/lib/files/cache/cache.php
parent2dc1b778b47c7a765b1c4b56aa928c74f7116946 (diff)
downloadnextcloud-server-56e9ce44c3ac18d6183a8959c690c6e3269bc79e.tar.gz
nextcloud-server-56e9ce44c3ac18d6183a8959c690c6e3269bc79e.zip
add a way to recalucale the size of a folder in the cache
Diffstat (limited to 'tests/lib/files/cache/cache.php')
-rw-r--r--tests/lib/files/cache/cache.php11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/lib/files/cache/cache.php b/tests/lib/files/cache/cache.php
index 5a8d79b902c..57a154d295c 100644
--- a/tests/lib/files/cache/cache.php
+++ b/tests/lib/files/cache/cache.php
@@ -99,6 +99,17 @@ class Cache extends \UnitTestCase {
$this->assertEqual($value, $cachedData[$name]);
}
}
+
+ $file4 = 'folder/unkownSize';
+ $fileData['unkownSize'] = array('size' => -1, 'mtime' => 25, 'mimetype' => 'foo/file');
+ $this->cache->put($file4, $fileData['unkownSize']);
+
+ $this->assertEquals(-1, $this->cache->calculateFolderSize($file1));
+
+ $fileData['unkownSize'] = array('size' => 5, 'mtime' => 25, 'mimetype' => 'foo/file');
+ $this->cache->put($file4, $fileData['unkownSize']);
+
+ $this->assertEquals(1025, $this->cache->calculateFolderSize($file1));
}
function testStatus() {