/** * add system keys such as the public share key and the recovery key * * @param array $accessList * @param array $publicKeys * @return array */ public function addSystemKeys(array $accessList, array $publicKeys) { if (!empty($accessList['public'])) { $publicKeys[$this->keyManager->getPublicShareKeyId()] = $this->keyManager->getPublicShareKey(); } if ($this->keyManager->recoveryKeyExists() && $this->util->isRecoveryEnabledForUser()) { $publicKeys[$this->keyManager->getRecoveryKeyId()] = $this->keyManager->getRecoveryKey(); } return $publicKeys; }
public function testRecoveryKeyExists() { $this->keyStorageMock->expects($this->any())->method('getSystemUserKey')->with($this->equalTo($this->systemKeyId . '.publicKey'))->willReturn('recoveryKey'); $this->assertTrue($this->instance->recoveryKeyExists()); }