diff options
author | Côme Chilliet <come.chilliet@nextcloud.com> | 2023-03-17 10:32:51 +0100 |
---|---|---|
committer | Côme Chilliet <come.chilliet@nextcloud.com> | 2023-03-17 11:08:59 +0100 |
commit | 0750481bb72344dd5576866da119fadecf5f62d8 (patch) | |
tree | ec1c612b04bdcc28873ef976104635aba391fd30 /apps/encryption/tests/RecoveryTest.php | |
parent | 26d8fb0b6561fa89c67615144fc7a3d1414bb85b (diff) | |
download | nextcloud-server-0750481bb72344dd5576866da119fadecf5f62d8.tar.gz nextcloud-server-0750481bb72344dd5576866da119fadecf5f62d8.zip |
Adapt encryption recovery tests to new system
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Diffstat (limited to 'apps/encryption/tests/RecoveryTest.php')
-rw-r--r-- | apps/encryption/tests/RecoveryTest.php | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/apps/encryption/tests/RecoveryTest.php b/apps/encryption/tests/RecoveryTest.php index 37b6671d5cb..af053515f8c 100644 --- a/apps/encryption/tests/RecoveryTest.php +++ b/apps/encryption/tests/RecoveryTest.php @@ -211,7 +211,8 @@ class RecoveryTest extends TestCase { ->willReturn([]); $this->cryptMock->expects($this->once()) - ->method('decryptPrivateKey'); + ->method('decryptPrivateKey') + ->willReturn('privateKey'); $this->instance->recoverUsersFiles('password', 'admin'); $this->addToAssertionCount(1); } @@ -226,8 +227,8 @@ class RecoveryTest extends TestCase { ->willReturn(true); $this->cryptMock->expects($this->once()) - ->method('multiKeyDecrypt') - ->willReturn(true); + ->method('multiKeyDecryptLegacy') + ->willReturn('multiKeyDecryptLegacyResult'); $this->fileMock->expects($this->once()) ->method('getAccessList') @@ -244,10 +245,13 @@ class RecoveryTest extends TestCase { $this->cryptMock->expects($this->once()) - ->method('multiKeyEncrypt'); + ->method('multiKeyEncrypt') + ->willReturn(['admin' => 'shareKey']); $this->keyManagerMock->expects($this->once()) - ->method('setAllFileKeys'); + ->method('deleteLegacyFileKey'); + $this->keyManagerMock->expects($this->once()) + ->method('setShareKey'); $this->assertNull(self::invokePrivate($this->instance, 'recoverFile', |