public static function PHPUnit_Framework_Assert::assertJsonFileNotEqualsJsonFile

Asserts that two JSON files are not equal.

Parameters

string $expectedFile:

string $actualFile:

string $message:

1 call to PHPUnit_Framework_Assert::assertJsonFileNotEqualsJsonFile()
Framework_AssertTest::testAssertJsonFileNotEqualsJsonFile in drupal/core/vendor/phpunit/phpunit/Tests/Framework/AssertTest.php
@covers PHPUnit_Framework_Assert::assertJsonFileNotEqualsJsonFile

File

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

Class

PHPUnit_Framework_Assert
A set of assert methods.

Code

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

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