public static function Framework_Constraint_JsonMatchesTest::evaluateDataprovider

File

drupal/core/vendor/phpunit/phpunit/Tests/Framework/Constraint/JsonMatchesTest.php, line 80

Class

Framework_Constraint_JsonMatchesTest
@package PHPUnit @author Bastian Feder <php@bastian-feder.de> @copyright 2011 Bastian Feder <php@bastian-feder.de> @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause @link …

Code

public static function evaluateDataprovider() {
  return array(
    'valid JSON' => array(
      TRUE,
      json_encode(array(
        'Mascott' => 'Tux',
      )),
      json_encode(array(
        'Mascott' => 'Tux',
      )),
    ),
    'error syntax' => array(
      FALSE,
      '{"Mascott"::}',
      json_encode(array(
        'Mascott' => 'Tux',
      )),
    ),
    'error UTF-8' => array(
      FALSE,
      json_encode('\\xB1\\x31'),
      json_encode(array(
        'Mascott' => 'Tux',
      )),
    ),
    'invalid JSON in class instantiation' => array(
      FALSE,
      json_encode(array(
        'Mascott' => 'Tux',
      )),
      '{"Mascott"::}',
    ),
  );
}