MockInterface
in
Interface MockInterface
Tags
Table of Contents
- 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
Return values
bool —getReplyFactory()
Returns reply factory which should be used to form the mocked response.
public
getReplyFactory() : ReplyFactoryInterface|null
Return values
ReplyFactoryInterface|null —getResponse()
Returns response which should be used as mock data.
public
getResponse() : ResponseInterface|null
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
Return values
Throwable|null —matches()
Returns true if underlying matcher has matched provided request.
public
matches(RequestInterface $request) : bool
It also returns false if matcher has matched request but hits condition is not met yet.
Parameters
- $request : RequestInterface
Return values
bool —registerHit()
Registers a hit to the mock.
public
registerHit() : MockInterface