summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2014-01-08 00:55:11 -0800
committerVincent Petry <pvince81@owncloud.com>2014-01-08 00:55:11 -0800
commit1614ad42b3ece31aed2b00f5592ee92b1ad1649e (patch)
tree756d689667faa2e86d7b437ea2157db8ab9a2704 /tests
parent6be2dee5bca4a38d621f5f5c408b1bd021722f29 (diff)
parent5be4af9f519ef8d0424f8b07ba84c43da9cf11f4 (diff)
downloadnextcloud-server-1614ad42b3ece31aed2b00f5592ee92b1ad1649e.tar.gz
nextcloud-server-1614ad42b3ece31aed2b00f5592ee92b1ad1649e.zip
Merge pull request #6673 from owncloud/master-quota-insufficientstorageforfilesfix
Now also preventing to override "files" dir size with -1
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/files/cache/homecache.php18
1 files changed, 12 insertions, 6 deletions
diff --git a/tests/lib/files/cache/homecache.php b/tests/lib/files/cache/homecache.php
index 2fa7f1ba92e..87fd0dba4c6 100644
--- a/tests/lib/files/cache/homecache.php
+++ b/tests/lib/files/cache/homecache.php
@@ -62,33 +62,39 @@ class HomeCache extends \PHPUnit_Framework_TestCase {
}
/**
- * Tests that the root folder size calculation ignores the subdirs that have an unknown
- * size. This makes sure that quota calculation still works as it's based on the root
- * folder size.
+ * Tests that the root and files folder size calculation ignores the subdirs
+ * that have an unknown size. This makes sure that quota calculation still
+ * works as it's based on the "files" folder size.
*/
public function testRootFolderSizeIgnoresUnknownUpdate() {
- $dir1 = 'knownsize';
- $dir2 = 'unknownsize';
+ $dir1 = 'files/knownsize';
+ $dir2 = 'files/unknownsize';
$fileData = array();
$fileData[''] = array('size' => -1, 'mtime' => 20, 'mimetype' => 'httpd/unix-directory');
+ $fileData['files'] = array('size' => -1, 'mtime' => 20, 'mimetype' => 'httpd/unix-directory');
$fileData[$dir1] = array('size' => 1000, 'mtime' => 20, 'mimetype' => 'httpd/unix-directory');
$fileData[$dir2] = array('size' => -1, 'mtime' => 25, 'mimetype' => 'httpd/unix-directory');
$this->cache->put('', $fileData['']);
+ $this->cache->put('files', $fileData['files']);
$this->cache->put($dir1, $fileData[$dir1]);
$this->cache->put($dir2, $fileData[$dir2]);
+ $this->assertTrue($this->cache->inCache('files'));
$this->assertTrue($this->cache->inCache($dir1));
$this->assertTrue($this->cache->inCache($dir2));
- // check that root size ignored the unknown sizes
+ // check that files and root size ignored the unknown sizes
+ $this->assertEquals(1000, $this->cache->calculateFolderSize('files'));
$this->assertEquals(1000, $this->cache->calculateFolderSize(''));
// clean up
$this->cache->remove('');
+ $this->cache->remove('files');
$this->cache->remove($dir1);
$this->cache->remove($dir2);
+ $this->assertFalse($this->cache->inCache('files'));
$this->assertFalse($this->cache->inCache($dir1));
$this->assertFalse($this->cache->inCache($dir2));
}