public function setUp() { parent::setUp(); $this->user = UserStub::create(); $this->jwtService = new JWTService(); $this->token = Token::fromUser($this->user); }
/** * requestAccessToken * @param User $user * @return EncodedToken */ public function requestAccessToken(User $user) { $token = Token::fromUser($user); return $this->jsonTokenService->encode($token); }
/** * Create a new EncodedToken * * @param $token * @return EncodedToken */ public function encode(Token $token) { return EncodedToken::fromNative(JWT::encode($token->toArray(), $this->key)); }