Guides
Tutorials
Asserts that a JSON document matches a given JSON Schema.
class ApiPlatform\Symfony\Bundle\Test\Constraint\MatchesJsonSchema extends PHPUnit\Framework\Constraint\Constraint implements PHPUnit\Framework\SelfDescribing, Countable
{
public __construct(object|array|string $schema, null|int $checkMode)
public toString(): string
protected matches($other): bool
protected additionalFailureDescription($other): string
public evaluate($other, string $description, bool $returnResult): bool
public count(): int
protected exporter(): SebastianBergmann\Exporter\Exporter
protected fail($other, string $description, null|SebastianBergmann\Comparator\ComparisonFailure $comparisonFailure): null
protected failureDescription($other): string
protected toStringInContext(PHPUnit\Framework\Constraint\Operator $operator, $role): string
protected failureDescriptionInContext(PHPUnit\Framework\Constraint\Operator $operator, $role, $other): string
protected reduce(): PHPUnit\Framework\Constraint\Constraint
}class ApiPlatform\Symfony\Bundle\Test\Constraint\MatchesJsonSchema extends PHPUnit\Framework\Constraint\Constraint implements PHPUnit\Framework\SelfDescribing, Countable
{
public __construct(object|array|string $schema, null|int $checkMode)
public toString(): string
protected matches($other): bool
protected additionalFailureDescription($other): string
public evaluate($other, string $description, bool $returnResult): bool
public count(): int
protected exporter(): SebastianBergmann\Exporter\Exporter
protected fail($other, string $description, null|SebastianBergmann\Comparator\ComparisonFailure $comparisonFailure): null
protected failureDescription($other): string
protected toStringInContext(PHPUnit\Framework\Constraint\Operator $operator, $role): string
protected failureDescriptionInContext(PHPUnit\Framework\Constraint\Operator $operator, $role, $other): string
protected reduce(): PHPUnit\Framework\Constraint\Constraint
}public __construct(object|array|string $schema, null|int $checkMode)public __construct(object|array|string $schema, null|int $checkMode)| schema | object array string | |
| checkMode | int |
Returns a string representation of the object.Returns a string representation of the object.
public toString(): stringpublic toString(): stringstring
Evaluates the constraint for parameter $other. Returns true if the constraint is met, false otherwise.This method can be overridden to implement the evaluation algorithm.
protected matches($other): boolprotected matches($other): bool| other |
bool
Return additional failure description where needed.The function can be overridden to provide additional failure information like a diff
protected additionalFailureDescription($other): stringprotected additionalFailureDescription($other): string| other |
string