You are here

public function ResponseTest::testFromJson in reCAPTCHA 7.2

Same name and namespace in other branches
  1. 6.2 recaptcha-php/tests/ReCaptcha/ResponseTest.php \ReCaptcha\ResponseTest::testFromJson()

@dataProvider provideJson

File

recaptcha-php/tests/ReCaptcha/ResponseTest.php, line 37

Class

ResponseTest

Namespace

ReCaptcha

Code

public function testFromJson($json, $success, $errorCodes, $hostname, $challengeTs, $apkPackageName, $score, $action) {
  $response = Response::fromJson($json);
  $this
    ->assertEquals($success, $response
    ->isSuccess());
  $this
    ->assertEquals($errorCodes, $response
    ->getErrorCodes());
  $this
    ->assertEquals($hostname, $response
    ->getHostname());
  $this
    ->assertEquals($challengeTs, $response
    ->getChallengeTs());
  $this
    ->assertEquals($apkPackageName, $response
    ->getApkPackageName());
  $this
    ->assertEquals($score, $response
    ->getScore());
  $this
    ->assertEquals($action, $response
    ->getAction());
}