public static function PHPUnit_Framework_Assert::assertJsonStringNotEqualsJsonFile

Asserts that the generated JSON encoded object and the content of the given file are not equal.

Parameters

string $expectedFile:

string $actualJson:

string $message:

2 calls to PHPUnit_Framework_Assert::assertJsonStringNotEqualsJsonFile()
Framework_AssertTest::testAssertJsonStringNotEqualsJsonFile in drupal/core/vendor/phpunit/phpunit/Tests/Framework/AssertTest.php
@covers PHPUnit_Framework_Assert::assertJsonStringNotEqualsJsonFile
Framework_AssertTest::testAssertJsonStringNotEqualsJsonFileExpectingException in drupal/core/vendor/phpunit/phpunit/Tests/Framework/AssertTest.php
@covers PHPUnit_Framework_Assert::assertJsonStringNotEqualsJsonFile

File

drupal/core/vendor/phpunit/phpunit/PHPUnit/Framework/Assert.php, line 2219

Class

PHPUnit_Framework_Assert
A set of assert methods.

Code

public static function assertJsonStringNotEqualsJsonFile($expectedFile, $actualJson, $message = '') {
  self::assertFileExists($expectedFile, $message);
  $expectedJson = file_get_contents($expectedFile);
  self::assertJson($expectedJson, $message);
  self::assertJson($actualJson, $message);

  // call constraint
  $constraint = new PHPUnit_Framework_Constraint_JsonMatches($expectedJson);
  self::assertThat($actualJson, new PHPUnit_Framework_Constraint_Not($constraint), $message);
}