Class MockPlugin
Queues mock responses or exceptions and delivers mock responses or exceptions in a fifo order.
- Guzzle\Common\AbstractHasDispatcher implements Guzzle\Common\HasDispatcherInterface
- Guzzle\Plugin\Mock\MockPlugin implements Symfony\Component\EventDispatcher\EventSubscriberInterface, Countable
public
|
#
__construct( array $items = null, boolean $temporary = false, boolean $readBodies = false )
Constructor |
public static
array
|
|
public static
array
|
|
public static
|
|
public
|
#
readBodies( boolean $readBodies )
Set whether or not to consume the entity body of a request when a mock response is used |
public
integer
|
|
public
|
#
addResponse( string|
Add a response to the end of the queue |
public
|
|
public
|
|
public
array
|
|
public
boolean
|
|
public
|
#
dequeue(
Get a response from the front of the list and add it to a request |
public
|
|
public
array
|
|
public
|
addSubscriber(),
dispatch(),
getEventDispatcher(),
setEventDispatcher()
|
protected
array
|
$queue | array() |
#
Array of mock responses / exceptions |
protected
boolean
|
$temporary | false |
#
Whether or not to remove the plugin when the queue is empty |
protected
array
|
$received | array() |
#
Array of requests that were mocked |
protected
boolean
|
$readBodies |
|
#
Whether or not to consume an entity body when a mock response is served |
$eventDispatcher
|