diff options
author | Vincent Petry <pvince81@owncloud.com> | 2014-03-20 15:29:14 +0100 |
---|---|---|
committer | Vincent Petry <pvince81@owncloud.com> | 2014-03-20 15:29:14 +0100 |
commit | 316a22b46315a389e38cd9f1e320f3e1f0541d68 (patch) | |
tree | da7e385a0cf9b43b56446cb54cfdcec615a71b8b /tests/lib/files | |
parent | 5747e0e3f98d3c299b0bd46bb77ca7bf6b170312 (diff) | |
parent | 66bc0f0848846bce3680b79da4209d42620f1b8d (diff) | |
download | nextcloud-server-316a22b46315a389e38cd9f1e320f3e1f0541d68.tar.gz nextcloud-server-316a22b46315a389e38cd9f1e320f3e1f0541d68.zip |
Merge pull request #7808 from owncloud/quota-usequotaevenwhenfreespaceunknown
Still return quota value when free space is unknown
Diffstat (limited to 'tests/lib/files')
-rw-r--r-- | tests/lib/files/storage/wrapper/quota.php | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/lib/files/storage/wrapper/quota.php b/tests/lib/files/storage/wrapper/quota.php index bd2c69a7396..777529fd85e 100644 --- a/tests/lib/files/storage/wrapper/quota.php +++ b/tests/lib/files/storage/wrapper/quota.php @@ -61,6 +61,24 @@ class Quota extends \Test\Files\Storage\Storage { $this->assertEquals(6, $instance->free_space('')); } + public function testFreeSpaceWithUnknownDiskSpace() { + $storage = $this->getMock( + '\OC\Files\Storage\Local', + array('free_space'), + array(array('datadir' => $this->tmpDir)) + ); + $storage->expects($this->any()) + ->method('free_space') + ->will($this->returnValue(-2)); + $storage->getScanner()->scan(''); + + $instance = new \OC\Files\Storage\Wrapper\Quota(array('storage' => $storage, 'quota' => 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( |