You are here

public function ResponseTest::provideJson in reCAPTCHA 6.2

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

File

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

Class

ResponseTest

Namespace

ReCaptcha

Code

public function provideJson() {
  return array(
    array(
      '{"success": true}',
      true,
      array(),
    ),
    array(
      '{"success": false, "error-codes": ["test"]}',
      false,
      array(
        'test',
      ),
    ),
    array(
      '{"success": true, "error-codes": ["test"]}',
      true,
      array(),
    ),
    array(
      '{"success": false}',
      false,
      array(),
    ),
    array(
      'BAD JSON',
      false,
      array(
        'invalid-json',
      ),
    ),
  );
}