Exemplo n.º 1
0
 function testSign()
 {
     $expected = array('jwt' => 'eyJ0eXAiOiJKV1QiLCJhbGciOiJub25lIn0.eyJmb28iOiJiYXIifQ.', 'jws' => 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJmb28iOiJiYXIifQ.bVhBeMrW5g33Vi4FLSLn7aqcmAiupmmw-AY17YxCYLI');
     $expected_with_signature = '';
     $jwt = new JOSE_JWT(array('foo' => 'bar'));
     $jws = $jwt->sign('secret');
     $this->assertEquals($expected['jwt'], $jwt->toString());
     // no signature for the original $jwt object
     $this->assertEquals($expected['jws'], $jws->toString());
 }