Properties

$serviceBuilder

$serviceBuilder : 

Type

$server

$server : 

Type

$mockObserver

$mockObserver : 

Type

$mockBasePath

$mockBasePath : 

Type

$retried

$retried : 

Type

$requests

$requests : 

Type

Methods

getServer()

getServer() : \Guzzle\Tests\Http\Server

Get the global server object used throughout the unit tests of Guzzle

Returns

\Guzzle\Tests\Http\Server

getServiceBuilder()

getServiceBuilder() : \Guzzle\Service\Builder\ServiceBuilder

Get a service builder object that can be used throughout the service tests

Returns

\Guzzle\Service\Builder\ServiceBuilder

setMockBasePath()

setMockBasePath(string  $path) : \Guzzle\Tests\GuzzleTestCase

Set the mock response base path

Parameters

string $path

Path to mock response folder

Returns

\Guzzle\Tests\GuzzleTestCase

addMockedRequest()

addMockedRequest(\Guzzle\Http\Message\RequestInterface  $request) : self

Mark a request as being mocked

Parameters

\Guzzle\Http\Message\RequestInterface $request

Returns

self

getMockedRequests()

getMockedRequests() : array

Get all of the mocked requests

Returns

array

getMockResponse()

getMockResponse(string  $path) : \Guzzle\Http\Message\Response

Get a mock response for a client by mock file name

Parameters

string $path

Relative path to the mock response file

Returns

\Guzzle\Http\Message\Response

setMockResponse()

setMockResponse(\Guzzle\Http\Client  $client, string  $paths) : \Guzzle\Plugin\Mock\MockPlugin

Set a mock response from a mock file on the next client request.

This method assumes that mock response files are located under the Command/Mock/ directory of the Service being tested (e.g. Unfuddle/Command/Mock/). A mock response is added to the next request sent by the client.

Parameters

\Guzzle\Http\Client $client

Client object to modify

string $paths

Path to files within the Mock folder of the service

Returns

\Guzzle\Plugin\Mock\MockPlugin

returns the created mock plugin

compareHeaders()

compareHeaders(array  $filteredHeaders, array  $actualHeaders) : array|boolean

Compare HTTP headers and use special markup to filter values A header prefixed with '!' means it must not exist A header prefixed with '_' means it must be ignored A header value of '*' means anything after the * will be ignored

Parameters

array $filteredHeaders

Array of special headers

array $actualHeaders

Array of headers to check against

Returns

array|boolean —

Returns an array of the differences or FALSE if none

assertContainsIns()

assertContainsIns(string  $needle, string  $haystack, string  $message = null) 

Case insensitive assertContains

Parameters

string $needle

Search string

string $haystack

Search this

string $message

Optional failure message

setUp()

setUp() 

getSubscribedEvents()

getSubscribedEvents() : array

Returns an array of event names this subscriber wants to listen to.

The array keys are event names and the value can be:

  • The method name to call (priority defaults to 0)
  • An array composed of the method name to call and the priority
  • An array of arrays composed of the method names to call and respective priorities, or 0 if unset

For instance:

  • array('eventName' => 'methodName')
  • array('eventName' => array('methodName', $priority))
  • array('eventName' => array(array('methodName1', $priority), array('methodName2')))

Returns

array —

The event names to listen to

onRequestRetry()

onRequestRetry(\Guzzle\Common\Event  $event) 

Parameters

\Guzzle\Common\Event $event

testHasEventList()

testHasEventList() 

testCreatesDefaultExponentialBackoffPlugin()

testCreatesDefaultExponentialBackoffPlugin() 

testDoesNotRetryUnlessStrategyReturnsNumber()

testDoesNotRetryUnlessStrategyReturnsNumber() 

testUpdatesRequestForRetry()

testUpdatesRequestForRetry() 

testDoesNothingWhenNotRetryingAndPollingRequest()

testDoesNothingWhenNotRetryingAndPollingRequest() 

testRetriesRequests()

testRetriesRequests() 

testFailsOnTruncation()

testFailsOnTruncation() 

testRetriesRequestsWhenInParallel()

testRetriesRequestsWhenInParallel() 

testRetriesPooledRequestsUsingDelayAndPollingEvent()

testRetriesPooledRequestsUsingDelayAndPollingEvent() 

testSeeksToBeginningOfRequestBodyWhenRetrying()

testSeeksToBeginningOfRequestBodyWhenRetrying() 

testDoesNotSeekOnRequestsWithNoBodyWhenRetrying()

testDoesNotSeekOnRequestsWithNoBodyWhenRetrying()