diff options
author | Roeland Jago Douma <rullzer@users.noreply.github.com> | 2017-04-12 16:04:03 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-12 16:04:03 +0200 |
commit | dccb8928a11fd572337d8b6ff5987cb411172276 (patch) | |
tree | 37d47b0facb1c1c82800a570d75f5ad8b1308a03 /tests | |
parent | b90e91144bc8d378f6f52025f04383ae2e7c647b (diff) | |
parent | 30817fa319a3d5d7e4b64f774a8a02c1e9578d41 (diff) | |
download | nextcloud-server-dccb8928a11fd572337d8b6ff5987cb411172276.tar.gz nextcloud-server-dccb8928a11fd572337d8b6ff5987cb411172276.zip |
Merge pull request #4325 from nextcloud/downstream-27522
Optimize put - Dont try to fetch filecache for not existing filecache…
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lib/Files/Storage/Wrapper/EncryptionTest.php | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/tests/lib/Files/Storage/Wrapper/EncryptionTest.php b/tests/lib/Files/Storage/Wrapper/EncryptionTest.php index fb3b463e43b..eb665af8dda 100644 --- a/tests/lib/Files/Storage/Wrapper/EncryptionTest.php +++ b/tests/lib/Files/Storage/Wrapper/EncryptionTest.php @@ -614,11 +614,15 @@ class EncryptionTest extends Storage { * * @dataProvider dataTestGetHeaderAddLegacyModule */ - public function testGetHeaderAddLegacyModule($header, $isEncrypted, $expected) { + public function testGetHeaderAddLegacyModule($header, $isEncrypted, $exists, $expected) { $sourceStorage = $this->getMockBuilder('\OC\Files\Storage\Storage') ->disableOriginalConstructor()->getMock(); + $sourceStorage->expects($this->once()) + ->method('file_exists') + ->willReturn($exists); + $util = $this->getMockBuilder('\OC\Encryption\Util') ->setConstructorArgs([new View(), new Manager($this->config), $this->groupManager, $this->config, $this->arrayCache]) ->getMock(); @@ -657,9 +661,10 @@ class EncryptionTest extends Storage { public function dataTestGetHeaderAddLegacyModule() { return [ - [['cipher' => 'AES-128'], true, ['cipher' => 'AES-128', Util::HEADER_ENCRYPTION_MODULE_KEY => 'OC_DEFAULT_MODULE']], - [[], true, [Util::HEADER_ENCRYPTION_MODULE_KEY => 'OC_DEFAULT_MODULE']], - [[], false, []], + [['cipher' => 'AES-128'], true, true, ['cipher' => 'AES-128', Util::HEADER_ENCRYPTION_MODULE_KEY => 'OC_DEFAULT_MODULE']], + [[], true, false, []], + [[], true, true, [Util::HEADER_ENCRYPTION_MODULE_KEY => 'OC_DEFAULT_MODULE']], + [[], false, true, []], ]; } |