diff options
author | Bjoern Schiessle <schiessle@owncloud.com> | 2015-03-30 17:29:05 +0200 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2015-04-07 13:30:28 +0200 |
commit | 0eee3a2618235bcb59ce1bcb98526a7592de4578 (patch) | |
tree | 760c65a1a61f5dc928e8f80516fb9c58ea43040b /tests | |
parent | d185761d31f4845e9bf39dbbe0c61d199689deb7 (diff) | |
download | nextcloud-server-0eee3a2618235bcb59ce1bcb98526a7592de4578.tar.gz nextcloud-server-0eee3a2618235bcb59ce1bcb98526a7592de4578.zip |
remove unencrypted_size from the cache, size will contain the unencrypted size
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lib/files/cache/cache.php | 7 | ||||
-rw-r--r-- | tests/lib/files/storage/wrapper/quota.php | 6 |
2 files changed, 5 insertions, 8 deletions
diff --git a/tests/lib/files/cache/cache.php b/tests/lib/files/cache/cache.php index f0ad6cf3ab1..3d7f77cb54e 100644 --- a/tests/lib/files/cache/cache.php +++ b/tests/lib/files/cache/cache.php @@ -183,8 +183,8 @@ class Cache extends \Test\TestCase { $file3 = 'folder/foo'; $data1 = array('size' => 100, 'mtime' => 50, 'mimetype' => 'httpd/unix-directory'); $fileData = array(); - $fileData['bar'] = array('size' => 1000, 'unencrypted_size' => 900, 'encrypted' => 1, 'mtime' => 20, 'mimetype' => 'foo/file'); - $fileData['foo'] = array('size' => 20, 'unencrypted_size' => 16, 'encrypted' => 1, 'mtime' => 25, 'mimetype' => 'foo/file'); + $fileData['bar'] = array('size' => 1000, 'encrypted' => 1, 'mtime' => 20, 'mimetype' => 'foo/file'); + $fileData['foo'] = array('size' => 20, 'encrypted' => 1, 'mtime' => 25, 'mimetype' => 'foo/file'); $this->cache->put($file1, $data1); $this->cache->put($file2, $fileData['bar']); @@ -194,8 +194,6 @@ class Cache extends \Test\TestCase { $this->assertEquals(count($content), 2); foreach ($content as $cachedData) { $data = $fileData[$cachedData['name']]; - // indirect retrieval swaps unencrypted_size and size - $this->assertEquals($data['unencrypted_size'], $cachedData['size']); } $file4 = 'folder/unkownSize'; @@ -211,7 +209,6 @@ class Cache extends \Test\TestCase { // direct cache entry retrieval returns the original values $entry = $this->cache->get($file1); $this->assertEquals(1025, $entry['size']); - $this->assertEquals(916, $entry['unencrypted_size']); $this->cache->remove($file2); $this->cache->remove($file3); diff --git a/tests/lib/files/storage/wrapper/quota.php b/tests/lib/files/storage/wrapper/quota.php index 8ca8f308b71..ec2c907ba90 100644 --- a/tests/lib/files/storage/wrapper/quota.php +++ b/tests/lib/files/storage/wrapper/quota.php @@ -59,7 +59,7 @@ class Quota extends \Test\Files\Storage\Storage { public function testFreeSpaceWithUsedSpace() { $instance = $this->getLimitedStorage(9); $instance->getCache()->put( - '', array('size' => 3, 'unencrypted_size' => 0) + '', array('size' => 3) ); $this->assertEquals(6, $instance->free_space('')); } @@ -77,7 +77,7 @@ class Quota extends \Test\Files\Storage\Storage { $instance = new \OC\Files\Storage\Wrapper\Quota(array('storage' => $storage, 'quota' => 9)); $instance->getCache()->put( - '', array('size' => 3, 'unencrypted_size' => 0) + '', array('size' => 3) ); $this->assertEquals(6, $instance->free_space('')); } @@ -85,7 +85,7 @@ class Quota extends \Test\Files\Storage\Storage { public function testFreeSpaceWithUsedSpaceAndEncryption() { $instance = $this->getLimitedStorage(9); $instance->getCache()->put( - '', array('size' => 7, 'unencrypted_size' => 3) + '', array('size' => 7) ); $this->assertEquals(6, $instance->free_space('')); } |