expectException(\Jose\Component\Checker\InvalidClaimException::class); $this->expectExceptionMessage('"nbf" must be an integer.'); $checker = new NotBeforeChecker(); $checker->checkClaim('foo'); } /** * @test */ public function theNotBeforeClaimIsInTheFutur(): void { $this->expectException(\Jose\Component\Checker\InvalidClaimException::class); $this->expectExceptionMessage('The JWT can not be used yet.'); $checker = new NotBeforeChecker(); $checker->checkClaim(time() + 3600); } /** * @test */ public function theNotBeforeClaimIsInThePast(): void { $checker = new NotBeforeChecker(); $checker->checkClaim(time() - 3600); static::assertEquals('nbf', $checker->supportedClaim()); } }