[Pkg-owncloud-commits] [owncloud] 33/457: Add a unit test for the decrypt method
David Prévot
taffit at moszumanska.debian.org
Sun Jun 28 20:05:20 UTC 2015
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch stable8
in repository owncloud.
commit 4444db61b7accb7627c6c939e33e8af0439b167e
Author: Joas Schilling <nickvergessen at owncloud.com>
Date: Mon May 18 13:40:08 2015 +0200
Add a unit test for the decrypt method
---
apps/encryption/tests/lib/crypto/encryptionTest.php | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/apps/encryption/tests/lib/crypto/encryptionTest.php b/apps/encryption/tests/lib/crypto/encryptionTest.php
index 419aed7..509cd9db 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');
+ }
}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git
More information about the Pkg-owncloud-commits
mailing list