You are here

public function ReCaptchaTest::testVerifyBelowThreshold in reCAPTCHA 7.2

File

recaptcha-php/tests/ReCaptcha/ReCaptchaTest.php, line 152

Class

ReCaptchaTest

Namespace

ReCaptcha

Code

public function testVerifyBelowThreshold() {
  $method = $this
    ->getMockRequestMethod('{"success": true, "score": "0.1"}');
  $rc = new ReCaptcha('secret', $method);
  $response = $rc
    ->setScoreThreshold('0.5')
    ->verify('response');
  $this
    ->assertFalse($response
    ->isSuccess());
  $this
    ->assertEquals(array(
    ReCaptcha::E_SCORE_THRESHOLD_NOT_MET,
  ), $response
    ->getErrorCodes());
}