summaryrefslogtreecommitdiffstats
path: root/tests/lib/files
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2014-03-11 13:04:20 +0100
committerRobin Appelman <icewind@owncloud.com>2014-03-11 13:04:20 +0100
commitd55c7223a96e259543d28f53474a17525fdac25f (patch)
treec2acd009ea815b0df04d608235a785990cea3f4d /tests/lib/files
parent06c6163265bf10e7aa84c2621d58323b3ad94963 (diff)
parentc1cb9ee9b0b19e17ddde046642fa01d52cda63bf (diff)
downloadnextcloud-server-d55c7223a96e259543d28f53474a17525fdac25f.tar.gz
nextcloud-server-d55c7223a96e259543d28f53474a17525fdac25f.zip
Merge branch 'master' into foldersize-reuse
Conflicts: lib/private/files/cache/homecache.php
Diffstat (limited to 'tests/lib/files')
-rw-r--r--tests/lib/files/storage/wrapper/quota.php16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/lib/files/storage/wrapper/quota.php b/tests/lib/files/storage/wrapper/quota.php
index 43eae78415d..bd2c69a7396 100644
--- a/tests/lib/files/storage/wrapper/quota.php
+++ b/tests/lib/files/storage/wrapper/quota.php
@@ -53,6 +53,22 @@ class Quota extends \Test\Files\Storage\Storage {
$this->assertEquals(9, $instance->free_space(''));
}
+ public function testFreeSpaceWithUsedSpace() {
+ $instance = $this->getLimitedStorage(9);
+ $instance->getCache()->put(
+ '', array('size' => 3, 'unencrypted_size' => 0)
+ );
+ $this->assertEquals(6, $instance->free_space(''));
+ }
+
+ public function testFreeSpaceWithUsedSpaceAndEncryption() {
+ $instance = $this->getLimitedStorage(9);
+ $instance->getCache()->put(
+ '', array('size' => 7, 'unencrypted_size' => 3)
+ );
+ $this->assertEquals(6, $instance->free_space(''));
+ }
+
public function testFWriteNotEnoughSpace() {
$instance = $this->getLimitedStorage(9);
$stream = $instance->fopen('foo', 'w+');