File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -42,6 +42,7 @@ public function __construct(
4242 protected readonly ClaimFactory $ claimFactory ,
4343 ) {
4444 $ this ->validate ();
45+ $ this ->validateCommonTimestamps ();
4546 }
4647
4748
@@ -50,6 +51,16 @@ protected function validate(): void
5051 }
5152
5253
54+ protected function validateCommonTimestamps (): void
55+ {
56+ $ this ->validateByCallbacks (
57+ $ this ->getExpirationTime (...),
58+ $ this ->getNotBefore (...),
59+ $ this ->getIssuedAt (...),
60+ );
61+ }
62+
63+
5364 /**
5465 * @throws \SimpleSAML\OpenID\Exceptions\JwsException
5566 */
Original file line number Diff line number Diff line change @@ -283,8 +283,8 @@ public function testCanGetEmptyPayload(): void
283283
284284 public function testThrowsOnPayloadDecodingError (): void
285285 {
286- $ this ->jwsMock ->expects ($ this ->once ())->method ('getPayload ' )->willReturn ('payload-json ' );
287- $ this ->jsonHelperMock ->expects ($ this ->once ())->method ('decode ' )
286+ $ this ->jwsMock ->expects ($ this ->atLeastOnce ())->method ('getPayload ' )->willReturn ('payload-json ' );
287+ $ this ->jsonHelperMock ->expects ($ this ->atLeastOnce ())->method ('decode ' )
288288 ->willThrowException (new \JsonException ('Error ' ));
289289
290290 $ this ->expectException (JwsException::class);
You can’t perform that action at this time.
0 commit comments