pock

Mock
in package
implements MockInterface

Class Mock

Tags
category

Mock

Interfaces, Classes, Traits and Enums

MockInterface
Interface MockInterface

Table of Contents

__construct()  : mixed
Mock constructor.
available()  : bool
Returns true if mock is still can be used.
getReplyFactory()  : ReplyFactoryInterface|null
Returns reply factory which should be used to form the mocked response.
getResponse()  : ResponseInterface|null
Returns response which should be used as mock data.
getThrowable()  : Throwable|null
Returns the throwable which will be thrown as mock data.
matches()  : bool
Returns true if underlying matcher has matched provided request.
registerHit()  : MockInterface
Registers a hit to the mock.

Methods

available()

Returns true if mock is still can be used.

public available() : bool
Tags
inheritDoc
Return values
bool

getResponse()

Returns response which should be used as mock data.

public getResponse() : ResponseInterface|null
Tags
inheritDoc
Return values
ResponseInterface|null

getThrowable()

Returns the throwable which will be thrown as mock data.

public getThrowable(RequestInterface $request) : Throwable|null
Parameters
$request : RequestInterface

This request may be set into exception if possible

Tags
inheritDoc
Return values
Throwable|null

matches()

Returns true if underlying matcher has matched provided request.

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

Search results