Ejemplo n.º 1
0
 /**
  * @test
  *
  * @uses Lcobucci\JWT\Token::__construct
  * @uses Lcobucci\JWT\Token::setEncoder
  *
  * @covers Lcobucci\JWT\Token::__toString
  * @covers Lcobucci\JWT\Token::getPayload
  */
 public function toStringMustReturnEncodedData()
 {
     $signature = $this->getMock(Signature::class, [], [], '', false);
     $signature->expects($this->any())->method('__toString')->willReturn('test');
     $token = new Token(['alg' => 'none'], [], $signature);
     $token->setEncoder($this->encoder);
     $this->createMockExpectations('test');
     $this->assertEquals('test.test.test', (string) $token);
 }
Ejemplo n.º 2
0
 /**
  * Returns the resultant token
  *
  * @return Token
  */
 public function getToken()
 {
     $token = new Token($this->headers, $this->claims, $this->signature);
     $token->setEncoder($this->encoder);
     return $token;
 }