PHP Class GuzzleHttp\Handler\MockHandler

Inheritance: implements Countable
Afficher le fichier Open project: guzzle/guzzle Class Usage Examples

Méthodes publiques

Méthode Description
__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.
__invoke ( Psr\Http\Message\RequestInterface $request, array $options )
append ( ) Adds one or more variadic requests, exceptions, callables, or promises to the queue.
count ( ) : integer Returns the number of remaining items in the queue.
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.
getLastOptions ( ) : array Get the last received request options.
getLastRequest ( ) : Psr\Http\Message\RequestInterface Get the last received request.

Private Methods

Méthode Description
invokeStats ( Psr\Http\Message\RequestInterface $request, array $options, Psr\Http\Message\ResponseInterface $response = null, $reason = null )

Method Details

__construct() public méthode

The passed in value must be an array of {@see Psr7\Http\Message\ResponseInterface} objects, Exceptions, callables, or Promises.
public __construct ( array $queue = null, callable $onFulfilled = null, callable $onRejected = null )
$queue array
$onFulfilled callable Callback to invoke when the return value is fulfilled.
$onRejected callable Callback to invoke when the return value is rejected.

__invoke() public méthode

public __invoke ( Psr\Http\Message\RequestInterface $request, array $options )
$request Psr\Http\Message\RequestInterface
$options array

append() public méthode

Adds one or more variadic requests, exceptions, callables, or promises to the queue.
public append ( )

count() public méthode

Returns the number of remaining items in the queue.
public count ( ) : integer
Résultat integer

createWithMiddleware() public static méthode

Creates a new MockHandler that uses the default handler stack list of middlewares.
public static createWithMiddleware ( array $queue = null, callable $onFulfilled = null, callable $onRejected = null ) : GuzzleHttp\HandlerStack
$queue array Array of responses, callables, or exceptions.
$onFulfilled callable Callback to invoke when the return value is fulfilled.
$onRejected callable Callback to invoke when the return value is rejected.
Résultat GuzzleHttp\HandlerStack

getLastOptions() public méthode

Get the last received request options.
public getLastOptions ( ) : array
Résultat array

getLastRequest() public méthode

Get the last received request.
public getLastRequest ( ) : Psr\Http\Message\RequestInterface
Résultat Psr\Http\Message\RequestInterface