public function ReCaptchaTest::testVerifyMergesErrors in reCAPTCHA 7.2
File
- recaptcha-php/
tests/ ReCaptcha/ ReCaptchaTest.php, line 182
Class
Namespace
ReCaptchaCode
public function testVerifyMergesErrors() {
$method = $this
->getMockRequestMethod('{"success": false, "error-codes": ["initial-error"], "score": "0.1"}');
$rc = new ReCaptcha('secret', $method);
$response = $rc
->setScoreThreshold('0.5')
->verify('response');
$this
->assertFalse($response
->isSuccess());
$this
->assertEquals(array(
'initial-error',
ReCaptcha::E_SCORE_THRESHOLD_NOT_MET,
), $response
->getErrorCodes());
}