Exemplo n.º 1
0
 /**
  * @param User $user
  * @param string $token
  * @param string $userAgent
  * @param string $ip4
  * @return self
  */
 public static function createResetPasswordToken(User $user, $token, $userAgent, $ip4)
 {
     $expires = new DateTime('+1 hour');
     $userToken = new self($user, UserTokenType::internal(), $token, $userAgent, $ip4, $expires);
     $userToken->raise(new ResetPasswordEvent($user->getId(), $user->getEmail(), $user->getFullName(), $token));
     return $userToken;
 }
 protected function preBuild()
 {
     $this->entityDTO->isInternal = $this->entity->isInternal();
     $this->entityDTO->isGoogle = $this->entity->isGoogle();
     $this->entityDTO->isFacebook = $this->entity->isFacebook();
     $this->entityDTO->isTwitter = $this->entity->isTwitter();
     $this->entityDTO->isYahoo = $this->entity->isYahoo();
 }
Exemplo n.º 3
0
 public function getUserTokenType()
 {
     return UserTokenType::internal();
 }
Exemplo n.º 4
0
 public function testCreateByIdThrowsExceptionWhenInvalid()
 {
     $this->setExpectedException(InvalidArgumentException::class);
     UserTokenType::createById(999);
 }