src/Guzzle/Plugin/Mock/MockPlugin.php
public function onRequestBeforeSend(Event $event)
    {
        if (!$this->queue) {
            throw new \OutOfBoundsException('Mock queue is empty');
        }

        $request = $event['request'];
        $this->received[] = $request;
        // Detach the filter from the client so it's a one-time use
        if ($this->temporary && count($this->queue) == 1 && $request->getClient()) {
            $request->getClient()->getEventDispatcher()->removeSubscriber($this);
        }
        $this->dequeue($request);
    }
public function onRequestBeforeSend(Event $event)
    {
        if (!$this->queue) {
            throw new \OutOfBoundsException('Mock queue is empty');
        }

        $request = $event['request'];
        $this->received[] = $request;
        // Detach the filter from the client so it's a one-time use
        if ($this->temporary && count($this->queue) == 1 && $request->getClient()) {
            $request->getClient()->getEventDispatcher()->removeSubscriber($this);
        }
        $this->dequeue($request);
    }
public function onRequestBeforeSend ( Event $ event ) { if ( ! $ this -> queue ) { throw new \ OutOfBoundsException ( 'Mock queue is empty' ) ; } $ request = $ event [ 'request' ] ; $ this -> received [ ] = $ request ; // Detach the filter from the client so it's a one-time use if ( $ this -> temporary && count ( $ this -> queue ) == 1 && $ request -> getClient ( ) ) { $ request -> getClient ( ) -> getEventDispatcher ( ) -> removeSubscriber ( $ this ) ; } $ this -> dequeue ( $ request ) ; }
Called when a request is about to be sent

@param Event $event
@throws \OutOfBoundsException When queue is empty
Called when a request is about to be sent