References MatchesJsonSchema
Reference
C
Class

ApiPlatform\Symfony\Bundle\Test\Constraint\MatchesJsonSchema

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
}

Methods

__construct

public __construct(object|array|string $schema, null|int $checkMode)

Parameters

schemaobject
array
string
checkModeint

toString

Returns a string representation of the object.Returns a string representation of the object.

public toString(): string

Returns

string

matches

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): bool

Parameters

other

Returns

bool

additionalFailureDescription

Return additional failure description where needed.The function can be overridden to provide additional failure information like a diff

protected additionalFailureDescription($other): string

Parameters

other

Returns

string

Made with love by

Les-Tilleuls.coop can help you design and develop your APIs and web projects, and train your teams in API Platform, Symfony, Next.js, Kubernetes and a wide range of other technologies.

Learn more

Copyright © 2023 Kévin Dunglas

Sponsored by Les-Tilleuls.coop