Exemplo n.º 1
0
 public function testIsValid_false_iatAndNbf()
 {
     $mutableJwt = new MutableJwt($this->claims, $this->secret, $this->header);
     $mutableJwt->addClaim('iat', time() - 1);
     $mutableJwt->addClaim('nbf', time() - 2);
     $jwt = new Jwt($mutableJwt->encode(), $this->secret);
     $this->assertFalse($jwt->isValid());
 }
Exemplo n.º 2
0
 public function testAddClaim()
 {
     $jwt = new Jwt($this->claims, $this->secret, $this->header);
     $jwt->addClaim('a', 1);
     $this->assertEquals(1, $jwt->getClaim('a')->get());
 }