diff options
author | blizzz <blizzz@arthur-schiwon.de> | 2022-06-11 01:42:34 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-11 01:42:34 +0300 |
commit | eeb4de0763ffc612af2b9e610685cce2f4af58be (patch) | |
tree | 2d9e7c9796d68dfd47935a3ac67074c9b4711b03 /tests/lib | |
parent | e2c213a4269244d1656c05fc3eb4fee4f32a4f21 (diff) | |
parent | fd2afe604ef1d8ef6d5ae9d497b0f01ae159b2f6 (diff) |
Merge pull request #32708 from nextcloud/unencrypted-size-24
[24] store unencrypted size in the unencrypted_size column
Diffstat (limited to 'tests/lib')
-rw-r--r-- | tests/lib/Files/ObjectStore/S3Test.php | 2 | ||||
-rw-r--r-- | tests/lib/Files/Storage/Wrapper/EncryptionTest.php | 7 | ||||
-rw-r--r-- | tests/lib/HelperStorageTest.php | 3 |
3 files changed, 8 insertions, 4 deletions
diff --git a/tests/lib/Files/ObjectStore/S3Test.php b/tests/lib/Files/ObjectStore/S3Test.php index a7a95d53375..fd451dc3c01 100644 --- a/tests/lib/Files/ObjectStore/S3Test.php +++ b/tests/lib/Files/ObjectStore/S3Test.php @@ -176,7 +176,7 @@ class S3Test extends ObjectStoreTest { // end of file reached fseek($result, $size); - self:self::assertTrue(feof($result)); + self::assertTrue(feof($result)); $this->assertNoUpload('testfilesizes'); } 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(''); |