summaryrefslogtreecommitdiffstats
path: root/tests/lib/files/storage/wrapper/quota.php
diff options
context:
space:
mode:
authorkondou <kondou@ts.unde.re>2014-03-21 20:23:31 +0100
committerkondou <kondou@ts.unde.re>2014-03-21 20:23:31 +0100
commitdda7129a243c7ebdbcdf9c2b5dbf167542402bc2 (patch)
treed03dff6783ebabb6273a19ed59a6b9b3731e923e /tests/lib/files/storage/wrapper/quota.php
parent556c6eca2397eaa03c4503822d647c8b6cb5e70e (diff)
parent4be0b3f6cce540282c6745d6bf3d2a0fa4ac65b4 (diff)
downloadnextcloud-server-dda7129a243c7ebdbcdf9c2b5dbf167542402bc2.tar.gz
nextcloud-server-dda7129a243c7ebdbcdf9c2b5dbf167542402bc2.zip
Merge branch 'master' of https://github.com/owncloud/core into last_cron_log
Diffstat (limited to 'tests/lib/files/storage/wrapper/quota.php')
-rw-r--r--tests/lib/files/storage/wrapper/quota.php18
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(