expectException(InvalidClaimException::class); $this->expectExceptionMessage('"iat" must be an integer.'); $checker = new IssuedAtChecker(); $checker->checkClaim('foo'); } /** * @test */ public function theIssuedAtClaimIsInTheFutur(): void { $this->expectException(InvalidClaimException::class); $this->expectExceptionMessage('The JWT is issued in the future.'); $checker = new IssuedAtChecker(); $checker->checkClaim(time() + 3600); } /** * @test */ public function theIssuedAtClaimIsInThePast(): void { $checker = new IssuedAtChecker(); $checker->checkClaim(time() - 3600); static::assertEquals('iat', $checker->supportedClaim()); } }