Open Monograph Press
3.3.0
|
Public Member Functions | |
__construct (array $queue=null, callable $onFulfilled=null, callable $onRejected=null) | |
__invoke (RequestInterface $request, array $options) | |
append () | |
count () | |
getLastOptions () | |
getLastRequest () | |
reset () | |
Static Public Member Functions | |
static | createWithMiddleware (array $queue=null, callable $onFulfilled=null, callable $onRejected=null) |
Handler that returns responses or throw exceptions from a queue.
Definition at line 15 of file MockHandler.php.
GuzzleHttp\Handler\MockHandler::__construct | ( | array | $queue = null , |
callable | $onFulfilled = null , |
||
callable | $onRejected = null |
||
) |
The passed in value must be an array of {
array | $queue | |
callable | $onFulfilled | Callback to invoke when the return value is fulfilled. |
callable | $onRejected | Callback to invoke when the return value is rejected. |
Definition at line 50 of file MockHandler.php.
GuzzleHttp\Handler\MockHandler::__invoke | ( | RequestInterface | $request, |
array | $options | ||
) |
Definition at line 63 of file MockHandler.php.
References GuzzleHttp\Promise\queue().
GuzzleHttp\Handler\MockHandler::append | ( | ) |
Adds one or more variadic requests, exceptions, callables, or promises to the queue.
Definition at line 132 of file MockHandler.php.
References GuzzleHttp\describe_type(), and GuzzleHttp\Promise\queue().
GuzzleHttp\Handler\MockHandler::count | ( | ) |
Returns the number of remaining items in the queue.
Definition at line 173 of file MockHandler.php.
References GuzzleHttp\Promise\queue().
|
static |
Creates a new MockHandler that uses the default handler stack list of middlewares.
array | $queue | Array of responses, callables, or exceptions. |
callable | $onFulfilled | Callback to invoke when the return value is fulfilled. |
callable | $onRejected | Callback to invoke when the return value is rejected. |
Definition at line 33 of file MockHandler.php.
References GuzzleHttp\HandlerStack\create().
GuzzleHttp\Handler\MockHandler::getLastOptions | ( | ) |
GuzzleHttp\Handler\MockHandler::getLastRequest | ( | ) |
Get the last received request.
Definition at line 153 of file MockHandler.php.
GuzzleHttp\Handler\MockHandler::reset | ( | ) |
Definition at line 178 of file MockHandler.php.
References GuzzleHttp\Promise\queue().