summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2014-03-10 09:38:24 +0100
committerVincent Petry <pvince81@owncloud.com>2014-03-10 09:38:24 +0100
commit26513bc17b1119060819e391c3faf2a391769f70 (patch)
treeb54e65ff4c86b315a3ab685a17293e9504d99337 /tests
parent212699e389e12e8f9fa7f30992b9b799c11c0299 (diff)
parent48d63a6278078d164774fd182f03ebba5e3c77ad (diff)
downloadnextcloud-server-26513bc17b1119060819e391c3faf2a391769f70.tar.gz
nextcloud-server-26513bc17b1119060819e391c3faf2a391769f70.zip
Merge pull request #7624 from owncloud/enc-encryptedusedspacefix
[master] Fixed used space to be based on unencrypted size
Diffstat (limited to 'tests')
-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+');