Beispiel #1
0
 public function testVerifyPassword()
 {
     $password = \PHPAuth\Model\User::hashPassword(self::PASSWORD_VALID);
     $user = new \PHPAuth\Model\User(self::USER_ID, self::EMAIL_VALID, $password, true);
     $this->assertTrue($user->verifyPassword(self::PASSWORD_VALID));
 }
Beispiel #2
0
 /**
  * Updates a user in the database.
  *
  * @param User $user
  *
  * @throws Exception
  */
 public function updateUser(\PHPAuth\Model\User $user)
 {
     $query = $this->dbh->prepare('
         UPDATE
             user
         SET
             user_email = ?,
             user_password_hash = ?,
             user_is_activated = ?
         WHERE
             user_id = ?
     ');
     $query->execute(array($user->getEmail(), $user->getPasswordHash(), $user->isActivated(), $user->getId()));
 }