pock

BodyMatcher
in package
implements RequestMatcherInterface uses SeekableStreamDataExtractor

Compares the complete request body with string, resource, or PSR-7 stream contents.

$pock->addMatcher(new BodyMatcher('expected body'));
Tags
category

BodyMatcher

Table of Contents

Interfaces

RequestMatcherInterface
Contract for reusable request matching rules registered through PockBuilder::addMatcher().

Methods

__construct()  : mixed
BodyMatcher constructor.
matches()  : bool
Return true when the request satisfies this rule.

Methods

__construct()

BodyMatcher constructor.

public __construct(StreamInterface|resource|string $contents) : mixed
Parameters
$contents : StreamInterface|resource|string

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