\Guzzle\Tests\Http\MessageEntityEnclosingRequestTest

Base testcase class for all Guzzle testcases.

Summary

Methods
Properties
Constants
getServer()
setServiceBuilder()
getServiceBuilder()
getWildcardObserver()
setMockBasePath()
addMockedRequest()
getMockedRequests()
getMockResponse()
setMockResponse()
compareHeaders()
assertContainsIns()
setUp()
tearDown()
testConstructorConfiguresRequest()
testCanSetBodyWithoutOverridingContentType()
testRequestIncludesBodyInMessage()
testRequestIncludesPostBodyInMessageOnlyWhenNoPostFiles()
testAddsPostFieldsAndSetsContentLength()
testAddsPostFilesAndSetsContentType()
testRequestBodyContainsPostFiles()
testRequestBodyAddsContentLength()
testRequestBodyDoesNotUseContentLengthWhenChunked()
testRequestHasMutableBody()
testSetPostFields()
testSetPostFiles()
testSetPostFilesThrowsExceptionWhenFileIsNotFound()
testThrowsExceptionWhenNonStringsAreAddedToPost()
testAllowsContentTypeInPostUploads()
testGuessesContentTypeOfPostUpload()
testAllowsContentDispositionFieldsInPostUploadsWhenSettingInBulk()
testPostRequestsUseApplicationXwwwForUrlEncodedForArrays()
testProcessMethodAddsContentType()
testPostRequestsUseMultipartFormDataWithFiles()
testCanSendMultipleRequestsUsingASingleRequestObject()
testRemovingPostFieldRebuildsPostFields()
testUsesChunkedTransferWhenBodyLengthCannotBeDetermined()
testThrowsExceptionWhenContentLengthCannotBeDeterminedAndUsingHttp1()
testAllowsNestedPostData()
testAllowsEmptyFields()
testFailsOnInvalidFiles()
testHandlesEmptyStrings()
testHoldsPostFiles()
testAllowsAtPrefixWhenAddingPostFiles()
testSetStateToTransferWithEmptyBodySetsContentLengthToZero()
testSettingExpectHeaderCutoffChangesRequest()
testStrictRedirectsCanBeSpecifiedOnEntityEnclosingRequests()
testCanDisableRedirects()
testSetsContentTypeWhenSettingBodyByGuessingFromEntityBody()
testDoesNotCloneBody()
$serviceBuilder
$server
$mockObserver
No constants found
hasSubscriber()
$mockBasePath
$client
N/A
No private methods found
$requests
N/A

Properties

$serviceBuilder

$serviceBuilder : 

Type

$server

$server : 

Type

$mockObserver

$mockObserver : 

Type

$mockBasePath

$mockBasePath : 

Type

$client

$client : 

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() 

tearDown()

tearDown() 

testConstructorConfiguresRequest()

testConstructorConfiguresRequest() 

testCanSetBodyWithoutOverridingContentType()

testCanSetBodyWithoutOverridingContentType() 

testRequestIncludesBodyInMessage()

testRequestIncludesBodyInMessage() 

testRequestIncludesPostBodyInMessageOnlyWhenNoPostFiles()

testRequestIncludesPostBodyInMessageOnlyWhenNoPostFiles() 

testAddsPostFieldsAndSetsContentLength()

testAddsPostFieldsAndSetsContentLength() 

testAddsPostFilesAndSetsContentType()

testAddsPostFilesAndSetsContentType() 

testRequestBodyContainsPostFiles()

testRequestBodyContainsPostFiles() 

testRequestBodyAddsContentLength()

testRequestBodyAddsContentLength() 

testRequestBodyDoesNotUseContentLengthWhenChunked()

testRequestBodyDoesNotUseContentLengthWhenChunked() 

testRequestHasMutableBody()

testRequestHasMutableBody() 

testSetPostFields()

testSetPostFields() 

testSetPostFiles()

testSetPostFiles() 

testSetPostFilesThrowsExceptionWhenFileIsNotFound()

testSetPostFilesThrowsExceptionWhenFileIsNotFound() 

testThrowsExceptionWhenNonStringsAreAddedToPost()

testThrowsExceptionWhenNonStringsAreAddedToPost() 

testAllowsContentTypeInPostUploads()

testAllowsContentTypeInPostUploads() 

testGuessesContentTypeOfPostUpload()

testGuessesContentTypeOfPostUpload() 

testAllowsContentDispositionFieldsInPostUploadsWhenSettingInBulk()

testAllowsContentDispositionFieldsInPostUploadsWhenSettingInBulk() 

testPostRequestsUseApplicationXwwwForUrlEncodedForArrays()

testPostRequestsUseApplicationXwwwForUrlEncodedForArrays() 

testProcessMethodAddsContentType()

testProcessMethodAddsContentType() 

testPostRequestsUseMultipartFormDataWithFiles()

testPostRequestsUseMultipartFormDataWithFiles() 

testCanSendMultipleRequestsUsingASingleRequestObject()

testCanSendMultipleRequestsUsingASingleRequestObject() 

testRemovingPostFieldRebuildsPostFields()

testRemovingPostFieldRebuildsPostFields() 

testUsesChunkedTransferWhenBodyLengthCannotBeDetermined()

testUsesChunkedTransferWhenBodyLengthCannotBeDetermined() 

testThrowsExceptionWhenContentLengthCannotBeDeterminedAndUsingHttp1()

testThrowsExceptionWhenContentLengthCannotBeDeterminedAndUsingHttp1() 

testAllowsNestedPostData()

testAllowsNestedPostData() 

testAllowsEmptyFields()

testAllowsEmptyFields() 

testFailsOnInvalidFiles()

testFailsOnInvalidFiles() 

testHandlesEmptyStrings()

testHandlesEmptyStrings() 

testHoldsPostFiles()

testHoldsPostFiles() 

testAllowsAtPrefixWhenAddingPostFiles()

testAllowsAtPrefixWhenAddingPostFiles() 

testSetStateToTransferWithEmptyBodySetsContentLengthToZero()

testSetStateToTransferWithEmptyBodySetsContentLengthToZero() 

testSettingExpectHeaderCutoffChangesRequest()

testSettingExpectHeaderCutoffChangesRequest() 

testStrictRedirectsCanBeSpecifiedOnEntityEnclosingRequests()

testStrictRedirectsCanBeSpecifiedOnEntityEnclosingRequests() 

testCanDisableRedirects()

testCanDisableRedirects() 

testSetsContentTypeWhenSettingBodyByGuessingFromEntityBody()

testSetsContentTypeWhenSettingBodyByGuessingFromEntityBody() 

testDoesNotCloneBody()

testDoesNotCloneBody()