/** * @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; }
public function testGetters() { $this->assertSame('Internal', UserTokenType::internal()->getName()); $this->assertSame('Google', UserTokenType::google()->getName()); $this->assertSame('Facebook', UserTokenType::facebook()->getName()); $this->assertSame('Twitter', UserTokenType::twitter()->getName()); $this->assertSame('Yahoo', UserTokenType::yahoo()->getName()); }
public function getUserTokenType() { return UserTokenType::internal(); }