function Assert::assertJson
Asserts that a string is a valid JSON string.
Throws
7 calls to Assert::assertJson()
- Assert::assertJsonFileEqualsJsonFile in vendor/
phpunit/ phpunit/ src/ Framework/ Assert.php - Asserts that two JSON files are equal.
- Assert::assertJsonFileNotEqualsJsonFile in vendor/
phpunit/ phpunit/ src/ Framework/ Assert.php - Asserts that two JSON files are not equal.
- Assert::assertJsonStringEqualsJsonFile in vendor/
phpunit/ phpunit/ src/ Framework/ Assert.php - Asserts that the generated JSON encoded object and the content of the given file are equal.
- Assert::assertJsonStringEqualsJsonString in vendor/
phpunit/ phpunit/ src/ Framework/ Assert.php - Asserts that two given JSON encoded objects or arrays are equal.
- Assert::assertJsonStringNotEqualsJsonFile in vendor/
phpunit/ phpunit/ src/ Framework/ Assert.php - Asserts that the generated JSON encoded object and the content of the given file are not equal.
File
-
vendor/
phpunit/ phpunit/ src/ Framework/ Assert.php, line 1895
Class
- Assert
- @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
Namespace
PHPUnit\FrameworkCode
public static final function assertJson(string $actual, string $message = '') : void {
static::assertThat($actual, static::isJson(), $message);
}