Ejemplo n.º 1
0
 function it_should_return_user_from_converter(JWTDecoder $decoder, SecurityUserConverter $converter, User $user)
 {
     $token = new \stdClass();
     $decoder->decode('qwerty')->shouldBeCalled()->willReturn($token);
     $converter->buildUserFromToken($token)->shouldBeCalled()->willReturn($user);
     $this->buildUserFromToken('qwerty')->shouldBe($user);
 }
Ejemplo n.º 2
0
 /**
  * @param  User $user
  * @return string
  */
 public function buildTokenFromUser(User $user)
 {
     return $this->encoder->encode($this->converter->buildTokenFromUser($user));
 }