\GuzzleHttp\HandlerMockHandler

Handler that returns responses or throw exceptions from a queue.

Summary

Methods
Properties
Constants
createWithMiddleware()
__construct()
__invoke()
append()
getLastRequest()
getLastOptions()
count()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
invokeStats()
$queue
$lastRequest
$lastOptions
$onFulfilled
$onRejected
N/A

Properties

$queue

$queue : 

Type

$lastRequest

$lastRequest : 

Type

$lastOptions

$lastOptions : 

Type

$onFulfilled

$onFulfilled : 

Type

$onRejected

$onRejected : 

Type

Methods

createWithMiddleware()

createWithMiddleware(array  $queue = null, callable  $onFulfilled = null, callable  $onRejected = null) : \GuzzleHttp\HandlerStack

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.

Returns

\GuzzleHttp\HandlerStack

__construct()

__construct(array  $queue = null, callable  $onFulfilled = null, callable  $onRejected = null) 

The passed in value must be an array of {@see Psr7\Http\Message\ResponseInterface} objects, Exceptions, callables, or Promises.

Parameters

array $queue
callable $onFulfilled

Callback to invoke when the return value is fulfilled.

callable $onRejected

Callback to invoke when the return value is rejected.

append()

append() 

Adds one or more variadic requests, exceptions, callables, or promises to the queue.

getLastOptions()

getLastOptions() : array

Get the last received request options.

Returns

array

count()

count() : integer

Returns the number of remaining items in the queue.

Returns

integer