예제 #1
0
 /**
  * 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;
 }
예제 #2
0
 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']);
 }