summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@owncloud.com>2015-05-18 13:40:08 +0200
committerJoas Schilling <nickvergessen@owncloud.com>2015-05-18 15:45:11 +0200
commit4444db61b7accb7627c6c939e33e8af0439b167e (patch)
tree27f7ec1808767b72f313c9bf243874403e06ced2 /apps
parent76761662547f5ac945f9103e290ad0b19e3d9d10 (diff)
downloadnextcloud-server-4444db61b7accb7627c6c939e33e8af0439b167e.tar.gz
nextcloud-server-4444db61b7accb7627c6c939e33e8af0439b167e.zip
Add a unit test for the decrypt method
Diffstat (limited to 'apps')
-rw-r--r--apps/encryption/tests/lib/crypto/encryptionTest.php12
1 files changed, 11 insertions, 1 deletions
diff --git a/apps/encryption/tests/lib/crypto/encryptionTest.php b/apps/encryption/tests/lib/crypto/encryptionTest.php
index 419aed72366..509cd9dbc40 100644
--- a/apps/encryption/tests/lib/crypto/encryptionTest.php
+++ b/apps/encryption/tests/lib/crypto/encryptionTest.php
@@ -63,6 +63,10 @@ class EncryptionTest extends TestCase {
$this->l10nMock = $this->getMockBuilder('OCP\IL10N')
->disableOriginalConstructor()
->getMock();
+ $this->l10nMock->expects($this->any())
+ ->method('t')
+ ->with($this->anything())
+ ->willReturnArgument(0);
$this->instance = new Encryption(
$this->cryptMock,
@@ -227,7 +231,6 @@ class EncryptionTest extends TestCase {
);
}
- /**
* by default the encryption module should encrypt regular files, files in
* files_versions and files in files_trashbin
*
@@ -252,4 +255,11 @@ class EncryptionTest extends TestCase {
);
}
+ /**
+ * @expectedException \OC\Encryption\Exceptions\DecryptionFailedException
+ * @expectedExceptionMessage Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you.
+ */
+ public function testDecrypt() {
+ $this->instance->decrypt('abc');
+ }
}