Overview

Namespaces

  • Docta
    • MercadoLibre
      • Exception
      • OAuth2
        • Client
          • Test
  • GuzzleHttp
    • Cookie
    • Exception
    • Handler
    • Promise
      • Test
      • Tests
    • Psr7
    • Test
      • Handler
    • Tests
      • CookieJar
      • Event
      • Exception
      • Handler
      • Promise
      • Psr7
  • League
    • OAuth2
      • Client
        • Grant
          • Exception
        • Provider
          • Exception
        • Test
          • Grant
          • Provider
            • Exception
            • Fake
          • Token
          • Tool
        • Token
        • Tool
  • None
  • Psr
    • Http
      • Message

Classes

  • CurlFactory
  • CurlHandler
  • CurlMultiHandler
  • MockHandler
  • Proxy
  • StreamHandler

Interfaces

  • CurlFactoryInterface

Functions

  • curl_setopt_array
  • Overview
  • Namespace
  • Class
  • Download

Class MockHandler

Handler that returns responses or throw exceptions from a queue.

GuzzleHttp\Handler\MockHandler implements Countable
Namespace: GuzzleHttp\Handler
Located at src/Handler/MockHandler.php
Methods summary
public static GuzzleHttp\HandlerStack
# createWithMiddleware( array $queue = null, callable $onFulfilled = null, callable $onRejected = null )

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

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

Parameters

$queue
Array of responses, callables, or exceptions.
$onFulfilled
Callback to invoke when the return value is fulfilled.
$onRejected
Callback to invoke when the return value is rejected.

Returns

GuzzleHttp\HandlerStack
public
# __construct( array $queue = null, callable $onFulfilled = null, callable $onRejected = null )

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

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

Parameters

$queue
$onFulfilled
Callback to invoke when the return value is fulfilled.
$onRejected
Callback to invoke when the return value is rejected.
public
# __invoke( Psr\Http\Message\RequestInterface $request, array $options )
public
# append( )

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

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

public Psr\Http\Message\RequestInterface
# getLastRequest( )

Get the last received request.

Get the last received request.

Returns

Psr\Http\Message\RequestInterface
public array
# getLastOptions( )

Get the last received request options.

Get the last received request options.

Returns

array
public integer
# count( )

Returns the number of remaining items in the queue.

Returns the number of remaining items in the queue.

Returns

integer

Implementation of

Countable::count()
MercadoLibre PHP SDK API documentation generated by ApiGen