aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorPiotr M <mrow4a@yahoo.com>2017-03-28 14:49:06 +0200
committerJoas Schilling <coding@schilljs.com>2017-04-12 12:54:20 +0200
commitdc78f1251eee236e65386439e51b8f45b1bc9d2d (patch)
treec822aeb2f5699f60a918cd90231a05f343cf28b9 /tests
parentaf42ca20252b166bec2da34970137ec790a18328 (diff)
downloadnextcloud-server-dc78f1251eee236e65386439e51b8f45b1bc9d2d.tar.gz
nextcloud-server-dc78f1251eee236e65386439e51b8f45b1bc9d2d.zip
Optimize put - Dont try to fetch filecache for not existing filecache in encription
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/Files/Storage/Wrapper/EncryptionTest.php13
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..4b2075c852e 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')
+ ->willReturnCallback(function() use ($exists) {return $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, []],
];
}