public static function PHPUnit_Framework_Assert::assertJsonFileNotEqualsJsonFile in Zircon Profile 8
Same name and namespace in other branches
- 8.0 vendor/phpunit/phpunit/src/Framework/Assert.php \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 vendor/
phpunit/ phpunit/ tests/ Framework/ AssertTest.php - @covers PHPUnit_Framework_Assert::assertJsonFileNotEqualsJsonFile
File
- vendor/
phpunit/ phpunit/ src/ Framework/ Assert.php, line 2291
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);
}