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