Psecio\Jwt\JwtTest::testDecodeJwtDataValid PHP Method

testDecodeJwtDataValid() public method

Test the decoding of a valid JWT token
    public function testDecodeJwtDataValid()
    {
        $header = new Header('test');
        $jwt = new Jwt($header);
        $jwt->issuer('http://example.org')->audience('http://example.com')->issuedAt(1356999524)->notBefore(1357000000)->expireTime(time() + 3600)->jwtId('id123456')->type('https://example.com/register')->custom('test', 'claim1');
        $result = $jwt->encode();
        $decoded = $jwt->decode($result);
        $this->assertEquals($decoded->iss, 'http://example.org');
        $this->assertEquals($decoded->typ, 'https://example.com/register');
    }