summaryrefslogtreecommitdiffstats
path: root/tests/lib
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2015-04-22 12:12:27 +0200
committerThomas Müller <thomas.mueller@tmit.eu>2015-04-22 12:12:27 +0200
commit987bc138df89be2d0afdf268ab5c991b1bbe830b (patch)
tree3609a0bc92a02131bde870974bd3198fa6e17c63 /tests/lib
parentfc4127dd62bdd1d9bd9339797607615a250ba33f (diff)
downloadnextcloud-server-987bc138df89be2d0afdf268ab5c991b1bbe830b.tar.gz
nextcloud-server-987bc138df89be2d0afdf268ab5c991b1bbe830b.zip
calling renameKeys() on directory level as well - fixes #15778
Diffstat (limited to 'tests/lib')
-rw-r--r--tests/lib/files/storage/wrapper/encryption.php17
1 files changed, 15 insertions, 2 deletions
diff --git a/tests/lib/files/storage/wrapper/encryption.php b/tests/lib/files/storage/wrapper/encryption.php
index 1082cafbd3d..228c7b08d61 100644
--- a/tests/lib/files/storage/wrapper/encryption.php
+++ b/tests/lib/files/storage/wrapper/encryption.php
@@ -12,6 +12,11 @@ class Encryption extends \Test\Files\Storage\Storage {
*/
private $sourceStorage;
+ /**
+ * @var \OC\Encryption\Keys\Storage | \PHPUnit_Framework_MockObject_MockObject
+ */
+ private $keyStore;
+
public function setUp() {
parent::setUp();
@@ -54,7 +59,7 @@ class Encryption extends \Test\Files\Storage\Storage {
$logger = $this->getMock('\OC\Log');
$this->sourceStorage = new Temporary(array());
- $keyStore = $this->getMockBuilder('\OC\Encryption\Keys\Storage')
+ $this->keyStore = $this->getMockBuilder('\OC\Encryption\Keys\Storage')
->disableOriginalConstructor()->getMock();
$mount = $this->getMockBuilder('\OC\Files\Mount\MountPoint')
->disableOriginalConstructor()
@@ -67,7 +72,7 @@ class Encryption extends \Test\Files\Storage\Storage {
'mountPoint' => '/',
'mount' => $mount
],
- $encryptionManager, $util, $logger, $file, null, $keyStore
+ $encryptionManager, $util, $logger, $file, null, $this->keyStore
);
}
@@ -91,6 +96,14 @@ class Encryption extends \Test\Files\Storage\Storage {
$encryptionModule->expects($this->any())->method('getUnencryptedBlockSize')->willReturn(8192);
return $encryptionModule;
}
+
+ public function testRename() {
+ $this->keyStore
+ ->expects($this->once())
+ ->method('renameKeys');
+ $this->instance->mkdir('folder');
+ $this->instance->rename('folder', 'flodder');
+ }
}
//