summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/private/Accounts/AccountManager.php6
-rw-r--r--tests/lib/Accounts/AccountsManagerTest.php2
2 files changed, 6 insertions, 2 deletions
diff --git a/lib/private/Accounts/AccountManager.php b/lib/private/Accounts/AccountManager.php
index bd23f6289c0..41fdad148aa 100644
--- a/lib/private/Accounts/AccountManager.php
+++ b/lib/private/Accounts/AccountManager.php
@@ -97,7 +97,7 @@ class AccountManager {
if (empty($userData)) {
$this->insertNewUser($user, $data);
} elseif ($userData !== $data) {
- $this->checkEmailVerification($userData, $data, $user);
+ $data = $this->checkEmailVerification($userData, $data, $user);
$data = $this->updateVerifyStatus($userData, $data);
$this->updateExistingUser($user, $data);
} else {
@@ -147,6 +147,7 @@ class AccountManager {
* @param $oldData
* @param $newData
* @param IUser $user
+ * @return array
*/
protected function checkEmailVerification($oldData, $newData, IUser $user) {
if ($oldData[self::PROPERTY_EMAIL]['value'] !== $newData[self::PROPERTY_EMAIL]['value']) {
@@ -160,7 +161,10 @@ class AccountManager {
'lastRun' => time()
]
);
+ $newData[AccountManager::PROPERTY_EMAIL]['verified'] = AccountManager::VERIFICATION_IN_PROGRESS;
}
+
+ return $newData;
}
/**
diff --git a/tests/lib/Accounts/AccountsManagerTest.php b/tests/lib/Accounts/AccountsManagerTest.php
index 90b4c4b9f67..6cefebdea86 100644
--- a/tests/lib/Accounts/AccountsManagerTest.php
+++ b/tests/lib/Accounts/AccountsManagerTest.php
@@ -95,7 +95,7 @@ class AccountsManagerTest extends TestCase {
if ($updateExisting) {
$accountManager->expects($this->once())->method('checkEmailVerification')
- ->with($oldData, $newData, $user);
+ ->with($oldData, $newData, $user)->willReturn($newData);
$accountManager->expects($this->once())->method('updateVerifyStatus')
->with($oldData, $newData)->willReturn($newData);
$accountManager->expects($this->once())->method('updateExistingUser')