You are here

public static function MockHandler::createWithMiddleware in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/guzzlehttp/guzzle/src/Handler/MockHandler.php \GuzzleHttp\Handler\MockHandler::createWithMiddleware()

Creates a new MockHandler that uses the default handler stack list of middlewares.

Parameters

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.:

Return value

MockHandler

File

vendor/guzzlehttp/guzzle/src/Handler/MockHandler.php, line 32

Class

MockHandler
Handler that returns responses or throw exceptions from a queue.

Namespace

GuzzleHttp\Handler

Code

public static function createWithMiddleware(array $queue = null, callable $onFulfilled = null, callable $onRejected = null) {
  return HandlerStack::create(new self($queue, $onFulfilled, $onRejected));
}