/** * Updates user's email address and updates auth storage with * updated user data * * @param array $user User data * @param string $email New email address * * @return array User data */ public function updateEmail(array $user, $email) { $user = $this->dao->updateEmail($user['id'], $email); $this->auth->clearIdentity(); $this->auth->getStorage()->write($user); return $user; }
public function testUpdateEmail() { $newEmail = '*****@*****.**'; $user = $this->dao->findByEmail($this->user['email']); $updatedUser = $this->dao->updateEmail($user['id'], $newEmail); $this->assertEquals($user['id'], $updatedUser['id']); $this->assertEquals($newEmail, $updatedUser['email']); }