summaryrefslogtreecommitdiffstats
path: root/apps/encryption/tests/Crypto/EncryptionTest.php
diff options
context:
space:
mode:
authorRoeland Jago Douma <rullzer@users.noreply.github.com>2019-11-28 08:36:10 +0100
committerGitHub <noreply@github.com>2019-11-28 08:36:10 +0100
commit669302e570024c83140ff5c4f4b1489c5a1c66ed (patch)
tree010182798f5c83193554031753e063a8a0b35ca1 /apps/encryption/tests/Crypto/EncryptionTest.php
parent125be68311a319f2b839e5aa4ea29cd642cd1e00 (diff)
parente3e782b63df4f1d65c86cb3b204b4bdecf93a6cd (diff)
downloadnextcloud-server-669302e570024c83140ff5c4f4b1489c5a1c66ed.tar.gz
nextcloud-server-669302e570024c83140ff5c4f4b1489c5a1c66ed.zip
Merge pull request #18064 from nextcloud/feature/php74
Add php7.4 support
Diffstat (limited to 'apps/encryption/tests/Crypto/EncryptionTest.php')
-rw-r--r--apps/encryption/tests/Crypto/EncryptionTest.php13
1 files changed, 7 insertions, 6 deletions
diff --git a/apps/encryption/tests/Crypto/EncryptionTest.php b/apps/encryption/tests/Crypto/EncryptionTest.php
index 1f628ff19c9..94e0729317f 100644
--- a/apps/encryption/tests/Crypto/EncryptionTest.php
+++ b/apps/encryption/tests/Crypto/EncryptionTest.php
@@ -73,7 +73,7 @@ class EncryptionTest extends TestCase {
/** @var \OCP\Files\Storage|\PHPUnit_Framework_MockObject_MockObject */
private $storageMock;
- public function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->storageMock = $this->getMockBuilder(Storage::class)
@@ -131,9 +131,10 @@ class EncryptionTest extends TestCase {
/**
* test if public key from owner is missing
*
- * @expectedException \OCA\Encryption\Exceptions\PublicKeyMissingException
*/
public function testEndUser2() {
+ $this->expectException(\OCA\Encryption\Exceptions\PublicKeyMissingException::class);
+
$this->instance->begin('/foo/bar', 'user2', 'r', array(), array('users' => array('user1', 'user2', 'user3')));
$this->endTest();
}
@@ -431,11 +432,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->expectException(\OC\Encryption\Exceptions\DecryptionFailedException::class);
+ $this->expectExceptionMessage('Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you.');
+
$this->instance->decrypt('abc');
}