Properties

$serviceBuilder

$serviceBuilder : 

Type

$server

$server : 

Type

$mockObserver

$mockObserver : 

Type

$mockBasePath

$mockBasePath : 

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

testAddsDefaultStorage()

testAddsDefaultStorage() 

testAddsDefaultCollaborators()

testAddsDefaultCollaborators() 

testAddsCallbackCollaborators()

testAddsCallbackCollaborators() 

testCanPassCacheAsOnlyArgumentToConstructor()

testCanPassCacheAsOnlyArgumentToConstructor() 

testUsesCreatedCacheStorage()

testUsesCreatedCacheStorage() 

testUsesProvidedOptions()

testUsesProvidedOptions() 

satisfyProvider()

satisfyProvider() 

testChecksIfResponseCanSatisfyRequest()

testChecksIfResponseCanSatisfyRequest(  $request,   $response,   $can,   $revalidates) 

Parameters

$request
$response
$can
$revalidates

satisfyFailedProvider()

satisfyFailedProvider() 

testChecksIfResponseCanSatisfyFailedRequest()

testChecksIfResponseCanSatisfyFailedRequest(  $request,   $response,   $can) 

Parameters

$request
$response
$can

testDoesNothingWhenRequestIsNotCacheable()

testDoesNothingWhenRequestIsNotCacheable() 

satisfiableProvider()

satisfiableProvider() 

testInjectsSatisfiableResponses()

testInjectsSatisfiableResponses(  $response) 

Parameters

$response

satisfiableOnErrorProvider()

satisfiableOnErrorProvider() 

testInjectsSatisfiableResponsesOnError()

testInjectsSatisfiableResponsesOnError(  $cacheResponse) 

Parameters

$cacheResponse

testInjectsSatisfiableResponsesOnException()

testInjectsSatisfiableResponsesOnException(  $cacheResponse) 

Parameters

$cacheResponse

unsatisfiableOnErrorProvider()

unsatisfiableOnErrorProvider() 

testDoesNotInjectUnsatisfiableResponsesOnError()

testDoesNotInjectUnsatisfiableResponsesOnError(  $requestCanCache,   $requestHeaders,   $cacheResponse) 

Parameters

$requestCanCache
$requestHeaders
$cacheResponse

testDoesNotInjectUnsatisfiableResponsesOnException()

testDoesNotInjectUnsatisfiableResponsesOnException(  $requestCanCache,   $requestHeaders,   $responseParts) 

Parameters

$requestCanCache
$requestHeaders
$responseParts

testCachesResponsesWhenCacheable()

testCachesResponsesWhenCacheable() 

testPurgesRequests()

testPurgesRequests() 

testAutoPurgesRequests()

testAutoPurgesRequests()