pock

JsonBodyMatcher extends AbstractSerializedBodyMatcher
in package
uses JsonDecoderTrait

Structurally compares a decoded JSON request body.

Tags
category

JsonBodyMatcher

Table of Contents

Methods

__construct()  : mixed
AbstractSerializedBodyMatcher constructor.
jsonDecode()  : mixed
json_decode which throws exception on error.
matches()  : bool
Return true when the request satisfies this rule.

Methods

__construct()

AbstractSerializedBodyMatcher constructor.

public __construct(array<string|int, mixed> $data) : mixed
Parameters
$data : array<string|int, mixed>
Tags
phpstan-ignore-next-line

jsonDecode()

json_decode which throws exception on error.

public static jsonDecode(string $json[, bool $associative = false ][, int $depth = 512 ][, int $flags = 0 ]) : mixed
Parameters
$json : string
$associative : bool = false
$depth : int = 512
$flags : int = 0
Tags
throws
JsonException
SuppressWarnings

(PHPMD.BooleanArgumentFlag)

matches()

Return true when the request satisfies this rule.

public matches(RequestInterface $request) : bool
Parameters
$request : RequestInterface
Tags
inheritDoc
Return values
bool
On this page

Search results