replaceUserKeys() actually deletes the users keys -> update method name and doc-block

This commit is contained in:
Bjoern Schiessle 2016-03-02 19:25:44 +01:00
parent 5e267589d4
commit 89223379ad
3 changed files with 5 additions and 3 deletions

View File

@ -296,7 +296,7 @@ class UserHooks implements IHook {
public function postPasswordReset($params) {
$password = $params['password'];
$this->keyManager->replaceUserKeys($params['uid']);
$this->keyManager->deleteUserKeys($params['uid']);
$this->userSetup->setupUser($params['uid'], $password);
}

View File

@ -557,9 +557,11 @@ class KeyManager {
}
/**
* creat a backup of the users private and public key and then delete it
*
* @param string $uid
*/
public function replaceUserKeys($uid) {
public function deleteUserKeys($uid) {
$this->backupAllKeys('password_reset');
$this->deletePublicKey($uid);
$this->deletePrivateKey($uid);

View File

@ -251,7 +251,7 @@ class UserHooksTest extends TestCase {
public function testPostPasswordReset() {
$this->keyManagerMock->expects($this->once())
->method('replaceUserKeys')
->method('deleteUserKeys')
->with('testUser');
$this->userSetupMock->expects($this->once())