diff options
author | Vincent Petry <pvince81@owncloud.com> | 2014-03-10 09:38:24 +0100 |
---|---|---|
committer | Vincent Petry <pvince81@owncloud.com> | 2014-03-10 09:38:24 +0100 |
commit | 26513bc17b1119060819e391c3faf2a391769f70 (patch) | |
tree | b54e65ff4c86b315a3ab685a17293e9504d99337 /tests | |
parent | 212699e389e12e8f9fa7f30992b9b799c11c0299 (diff) | |
parent | 48d63a6278078d164774fd182f03ebba5e3c77ad (diff) | |
download | nextcloud-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.php | 16 |
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+'); |