summaryrefslogtreecommitdiffstats
path: root/tests/lib
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2016-08-31 12:30:37 +0200
committerGitHub <noreply@github.com>2016-08-31 12:30:37 +0200
commite4311a2ebdf3eeda8b2f1022c19290dc68db8ae5 (patch)
tree8062098678e0627687ebe63ab4cac5e8a0d2d309 /tests/lib
parenta82d4a56fb5bc484114c702bcd63e6278830bd5d (diff)
parent351cab6bce41b53f9efd4ba9aed4e7435f843691 (diff)
downloadnextcloud-server-e4311a2ebdf3eeda8b2f1022c19290dc68db8ae5.tar.gz
nextcloud-server-e4311a2ebdf3eeda8b2f1022c19290dc68db8ae5.zip
Merge pull request #608 from nextcloud/small-encryption-improvement
skip shared files, if files get decrypted only for a specific user we…
Diffstat (limited to 'tests/lib')
-rw-r--r--tests/lib/Encryption/DecryptAllTest.php17
1 files changed, 14 insertions, 3 deletions
diff --git a/tests/lib/Encryption/DecryptAllTest.php b/tests/lib/Encryption/DecryptAllTest.php
index d7cf2fb7baf..ed86b743c3b 100644
--- a/tests/lib/Encryption/DecryptAllTest.php
+++ b/tests/lib/Encryption/DecryptAllTest.php
@@ -251,18 +251,29 @@ class DecryptAllTest extends TestCase {
->setMethods(['decryptFile'])
->getMock();
+ $storage = $this->getMockBuilder('OCP\Files\Storage')
+ ->disableOriginalConstructor()->getMock();
+
+
+ $sharedStorage = $this->getMockBuilder('OCP\Files\Storage')
+ ->disableOriginalConstructor()->getMock();
+
+ $sharedStorage->expects($this->once())->method('instanceOfStorage')
+ ->with('OC\Files\Storage\Shared')->willReturn(true);
+
$this->view->expects($this->at(0))->method('getDirectoryContent')
->with('/user1/files')->willReturn(
[
- new FileInfo('path', null, 'intPath', ['name' => 'foo', 'type'=>'dir'], null),
- new FileInfo('path', null, 'intPath', ['name' => 'bar', 'type'=>'file', 'encrypted'=>true], null)
+ new FileInfo('path', $storage, 'intPath', ['name' => 'foo', 'type'=>'dir'], null),
+ new FileInfo('path', $storage, 'intPath', ['name' => 'bar', 'type'=>'file', 'encrypted'=>true], null),
+ new FileInfo('path', $sharedStorage, 'intPath', ['name' => 'shared', 'type'=>'file', 'encrypted'=>true], null),
]
);
$this->view->expects($this->at(3))->method('getDirectoryContent')
->with('/user1/files/foo')->willReturn(
[
- new FileInfo('path', null, 'intPath', ['name' => 'subfile', 'type'=>'file', 'encrypted'=>true], null)
+ new FileInfo('path', $storage, 'intPath', ['name' => 'subfile', 'type'=>'file', 'encrypted'=>true], null)
]
);