diff --git a/tests/ReCaptcha/ReCaptchaTest.php b/tests/ReCaptcha/ReCaptchaTest.php index d734163..a7b62ee 100644 --- a/tests/ReCaptcha/ReCaptchaTest.php +++ b/tests/ReCaptcha/ReCaptchaTest.php @@ -258,6 +258,22 @@ public function testVerifyWithInvalidChallengeTsAndTimeout(): void $this->assertTrue($response->isSuccess()); } + public function testVerifyWithEmptyChallengeTsAndTimeout(): void + { + $method = $this->getMockRequestMethod('{"success": true, "challenge_ts": ""}'); + $rc = new ReCaptcha('secret', $method); + $response = $rc->setChallengeTimeout(60)->verify('response'); + $this->assertTrue($response->isSuccess()); + } + + public function testVerifyWithMissingChallengeTsAndTimeout(): void + { + $method = $this->getMockRequestMethod('{"success": true}'); + $rc = new ReCaptcha('secret', $method); + $response = $rc->setChallengeTimeout(60)->verify('response'); + $this->assertTrue($response->isSuccess()); + } + public function testVerifyMergesErrors(): void { $method = $this->getMockRequestMethod('{"success": false, "error-codes": ["initial-error"], "score": "0.1"}');