You are here

public function ReCaptchaTest::testVerifyActionMatch in reCAPTCHA 7.2

File

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

Class

ReCaptchaTest

Namespace

ReCaptcha

Code

public function testVerifyActionMatch() {
  $method = $this
    ->getMockRequestMethod('{"success": true, "action": "action/name"}');
  $rc = new ReCaptcha('secret', $method);
  $response = $rc
    ->setExpectedAction('action/name')
    ->verify('response');
  $this
    ->assertTrue($response
    ->isSuccess());
}