summaryrefslogtreecommitdiffstats
path: root/tests/lib
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2022-04-13 16:05:45 +0200
committerRobin Appelman <robin@icewind.nl>2022-06-02 16:07:00 +0200
commit8238582e59b7b6ec03318bcf81bf47cce54af320 (patch)
treeec45259377aeed1088baa9f5ad8c7891eb489af7 /tests/lib
parent2a68819a67045d87a369a8a6413f153b3b2bea5f (diff)
downloadnextcloud-server-8238582e59b7b6ec03318bcf81bf47cce54af320.tar.gz
nextcloud-server-8238582e59b7b6ec03318bcf81bf47cce54af320.zip
store unencrypted size in the unencrypted_size column
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'tests/lib')
-rw-r--r--tests/lib/Files/Storage/Wrapper/EncryptionTest.php7
-rw-r--r--tests/lib/HelperStorageTest.php3
2 files changed, 7 insertions, 3 deletions
diff --git a/tests/lib/Files/Storage/Wrapper/EncryptionTest.php b/tests/lib/Files/Storage/Wrapper/EncryptionTest.php
index d26e5c499e7..ebb97a25c77 100644
--- a/tests/lib/Files/Storage/Wrapper/EncryptionTest.php
+++ b/tests/lib/Files/Storage/Wrapper/EncryptionTest.php
@@ -5,6 +5,7 @@ namespace Test\Files\Storage\Wrapper;
use OC\Encryption\Exceptions\ModuleDoesNotExistsException;
use OC\Encryption\Update;
use OC\Encryption\Util;
+use OC\Files\Cache\CacheEntry;
use OC\Files\Storage\Temporary;
use OC\Files\Storage\Wrapper\Encryption;
use OC\Files\View;
@@ -259,7 +260,7 @@ class EncryptionTest extends Storage {
->method('get')
->willReturnCallback(
function ($path) use ($encrypted) {
- return ['encrypted' => $encrypted, 'path' => $path, 'size' => 0, 'fileid' => 1];
+ return new CacheEntry(['encrypted' => $encrypted, 'path' => $path, 'size' => 0, 'fileid' => 1]);
}
);
@@ -332,7 +333,7 @@ class EncryptionTest extends Storage {
->disableOriginalConstructor()->getMock();
$cache->expects($this->any())
->method('get')
- ->willReturn(['encrypted' => true, 'path' => '/test.txt', 'size' => 0, 'fileid' => 1]);
+ ->willReturn(new CacheEntry(['encrypted' => true, 'path' => '/test.txt', 'size' => 0, 'fileid' => 1]));
$this->instance = $this->getMockBuilder('\OC\Files\Storage\Wrapper\Encryption')
->setConstructorArgs(
@@ -910,7 +911,7 @@ class EncryptionTest extends Storage {
if ($copyResult) {
$cache->expects($this->once())->method('get')
->with($sourceInternalPath)
- ->willReturn(['encrypted' => $encrypted, 'size' => 42]);
+ ->willReturn(new CacheEntry(['encrypted' => $encrypted, 'size' => 42]));
if ($encrypted) {
$instance->expects($this->once())->method('updateUnencryptedSize')
->with($mountPoint . $targetInternalPath, 42);
diff --git a/tests/lib/HelperStorageTest.php b/tests/lib/HelperStorageTest.php
index 6d7ea513d3f..d3f480502b2 100644
--- a/tests/lib/HelperStorageTest.php
+++ b/tests/lib/HelperStorageTest.php
@@ -104,6 +104,9 @@ class HelperStorageTest extends \Test\TestCase {
$extStorage->file_put_contents('extfile.txt', 'abcdefghijklmnopq');
$extStorage->getScanner()->scan(''); // update root size
+ $config = \OC::$server->getConfig();
+ $config->setSystemValue('quota_include_external_storage', false);
+
\OC\Files\Filesystem::mount($extStorage, [], '/' . $this->user . '/files/ext');
$storageInfo = \OC_Helper::getStorageInfo('');