Lcobucci\JWT\Token::getPayload PHP Method

getPayload() public method

Returns the token payload
public getPayload ( ) : string
return string
    public function getPayload() : string
    {
        return $this->payload[0] . '.' . $this->payload[1];
    }

Usage Example

Example #1
0
 /**
  * @test
  *
  * @uses Lcobucci\JWT\Token::__construct
  *
  * @covers Lcobucci\JWT\Token::getPayload
  */
 public function getPayloadShouldReturnAStringWithTheTwoEncodePartsThatGeneratedTheToken()
 {
     $token = new Token(['alg' => 'none'], [], null, ['test1', 'test2', 'test3']);
     $this->assertEquals('test1.test2', $token->getPayload());
 }