summaryrefslogtreecommitdiffstats
path: root/tests/lib/files
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@owncloud.com>2015-04-24 14:27:23 +0200
committerJoas Schilling <nickvergessen@owncloud.com>2015-04-24 14:27:23 +0200
commit411f7893bf34507ba0b12b35a35596cd65c90b48 (patch)
treeb5cc4eb76e9d8a094a5956473d0c516b86ab774a /tests/lib/files
parent781cfff2216c4dfab109996f62ee7afd912dce17 (diff)
downloadnextcloud-server-411f7893bf34507ba0b12b35a35596cd65c90b48.tar.gz
nextcloud-server-411f7893bf34507ba0b12b35a35596cd65c90b48.zip
Add test "operation on keys failed"
Diffstat (limited to 'tests/lib/files')
-rw-r--r--tests/lib/files/storage/wrapper/encryption.php17
1 files changed, 10 insertions, 7 deletions
diff --git a/tests/lib/files/storage/wrapper/encryption.php b/tests/lib/files/storage/wrapper/encryption.php
index a257ca24a0c..de43c24659e 100644
--- a/tests/lib/files/storage/wrapper/encryption.php
+++ b/tests/lib/files/storage/wrapper/encryption.php
@@ -131,13 +131,14 @@ class Encryption extends \Test\Files\Storage\Storage {
*
* @param string $source
* @param string $target
+ * @param boolean $renameKeysReturn
* @param boolean $shouldUpdate
*/
- public function testRename($source, $target, $shouldUpdate) {
+ public function testRename($source, $target, $renameKeysReturn, $shouldUpdate) {
$this->keyStore
->expects($this->once())
->method('renameKeys')
- ->willReturn(true);
+ ->willReturn($renameKeysReturn);
$this->util->expects($this->any())
->method('isFile')->willReturn(true);
if ($shouldUpdate) {
@@ -158,13 +159,14 @@ class Encryption extends \Test\Files\Storage\Storage {
*
* @param string $source
* @param string $target
+ * @param boolean $copyKeysReturn
* @param boolean $shouldUpdate
*/
- public function testCopyTesting($source, $target, $shouldUpdate) {
+ public function testCopyTesting($source, $target, $copyKeysReturn, $shouldUpdate) {
$this->keyStore
->expects($this->once())
->method('copyKeys')
- ->willReturn(true);
+ ->willReturn($copyKeysReturn);
$this->util->expects($this->any())
->method('isFile')->willReturn(true);
if ($shouldUpdate) {
@@ -194,9 +196,10 @@ class Encryption extends \Test\Files\Storage\Storage {
*/
public function dataTestCopyAndRename() {
return array(
- array('source', 'target', false),
- array('source', 'target', false),
- array('source', '/subFolder/target', true),
+ array('source', 'target', false, false),
+ array('source', 'target', true, false),
+ array('source', '/subFolder/target', false, false),
+ array('source', '/subFolder/target', true, true),
);
}