MockInterface
in
Internal contract for a stateful request expectation and its configured outcome.
Tags
Table of Contents
Methods
- 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
boolgetReplyFactory()
Returns reply factory which should be used to form the mocked response.
public
getReplyFactory() : ReplyFactoryInterface|null
Return values
ReplyFactoryInterface|nullgetResponse()
Returns response which should be used as mock data.
public
getResponse() : ResponseInterface|null
Return values
ResponseInterface|nullgetThrowable()
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|nullmatches()
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
boolregisterHit()
Registers a hit to the mock.
public
registerHit() : MockInterface