File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed
Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change 2626
2727namespace web_eid \web_eid_authtoken_validation_php \validator ;
2828
29+ use DateTime ;
2930use web_eid \web_eid_authtoken_validation_php \testutil \AbstractTestWithValidator ;
3031use web_eid \web_eid_authtoken_validation_php \certificate \CertificateData ;
3132use web_eid \web_eid_authtoken_validation_php \exceptions \AuthTokenSignatureValidationException ;
3233use web_eid \web_eid_authtoken_validation_php \testutil \AuthTokenValidators ;
34+ use web_eid \web_eid_authtoken_validation_php \testutil \Dates ;
3335
3436class AuthTokenSignatureTest extends AbstractTestWithValidator
3537{
@@ -40,6 +42,11 @@ class AuthTokenSignatureTest extends AbstractTestWithValidator
4042 '"signature":"arx164xRiwhIQDINe0J+ZxJWZFOQTx0PBtOaWaxAe7gofEIHRIbV1w0sOCYBJnvmvMem9hU4nc2+iJx2x8poYck4Z6eI3GwtiksIec3XQ9ZIk1n/XchXnmPn3GYV+HzJ", ' .
4143 '"format":"web-eid:1.0"} ' ;
4244
45+ protected function tearDown (): void
46+ {
47+ Dates::resetMockedCertificateValidatorDate ();
48+ }
49+
4350 public function testWhenValidTokenAndNonceThenValidationSucceeds (): void
4451 {
4552 $ result = $ this ->validator ->validate ($ this ->validAuthToken , self ::VALID_CHALLENGE_NONCE );
@@ -68,6 +75,7 @@ public function testWhenValidTokenAndWrongOriginThenValidationFails(): void
6875
6976 public function testWhenTokenWithWrongCertThenValidationFails (): void
7077 {
78+ Dates::setMockedCertificateValidatorDate (new DateTime ('2024-08-01 10:13:43.000 ' ));
7179 $ authTokenValidator = AuthTokenValidators::getAuthTokenValidator ();
7280 $ authTokenWithWrongCert = $ authTokenValidator ->parse (self ::AUTH_TOKEN_WRONG_CERT );
7381
You can’t perform that action at this time.
0 commit comments