Documentation

OauthPluginTest extends GuzzleTestCase
in package

Base testcase class for all Guzzle testcases.

Tags
covers

Table of Contents

NONCE  = 'e7aa11195ca58349bec8b5ebe351d3497eb9e603'
TIMESTAMP  = '1327274290'
$mockObserver  : mixed
$server  : mixed
$serviceBuilder  : mixed
$config  : mixed
$mockBasePath  : mixed
$requests  : mixed
addMockedRequest()  : self
Mark a request as being mocked
assertContainsIns()  : mixed
Case insensitive assertContains
compareHeaders()  : array<string|int, mixed>|bool
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
getMockedRequests()  : array<string|int, mixed>
Get all of the mocked requests
getMockResponse()  : Response
Get a mock response for a client by mock file name
getServer()  : Server
Get the global server object used throughout the unit tests of Guzzle
getServiceBuilder()  : ServiceBuilder
Get a service builder object that can be used throughout the service tests
getWildcardObserver()  : MockObserver
Get a wildcard observer for an event dispatcher
setMockBasePath()  : GuzzleTestCase
Set the mock response base path
setMockResponse()  : MockPlugin
Set a mock response from a mock file on the next client request.
setServiceBuilder()  : mixed
Set the service builder to use for tests
testAcceptsConfigurationData()  : mixed
testConvertsBooleansToStrings()  : mixed
testCreatesStringToSignFromPostRequest()  : mixed
testCreatesStringToSignFromPostRequestWithCustomContentType()  : mixed
testCreatesStringToSignFromPostRequestWithNullValues()  : mixed
testCreatesStringToSignIgnoringPostFields()  : mixed
testDoesNotAddFalseyValuesToAuthorization()  : mixed
testInvalidArgumentExceptionOnMethodError()  : mixed
testMultiDimensionalArray()  : mixed
testMultiDimensionalArrayWithNonDefaultQueryAggregator()  : mixed
testOptionalOauthParametersAreNotAutomaticallyAdded()  : mixed
testSignsOauthQueryStringRequest()  : mixed
testSignsOauthRequests()  : mixed
Test that the Oauth is signed correctly and that extra strings haven't been added to the authorization header.
testSignsStrings()  : mixed
testSubscribesToEvents()  : mixed
getRequest()  : mixed
hasSubscriber()  : bool
Check if an event dispatcher has a subscriber

Constants

NONCE

public mixed NONCE = 'e7aa11195ca58349bec8b5ebe351d3497eb9e603'

Properties

$config

protected mixed $config = array('consumer_key' => 'foo', 'consumer_secret' => 'bar', 'token' => 'count', 'token_secret' => 'dracula')

Methods

assertContainsIns()

Case insensitive assertContains

public assertContainsIns(string $needle, string $haystack[, string $message = null ]) : mixed
Parameters
$needle : string

Search string

$haystack : string

Search this

$message : string = null

Optional failure message

Return values
mixed

compareHeaders()

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

public compareHeaders(array<string|int, mixed> $filteredHeaders, array<string|int, mixed> $actualHeaders) : array<string|int, mixed>|bool
Parameters
$filteredHeaders : array<string|int, mixed>

Array of special headers

$actualHeaders : array<string|int, mixed>

Array of headers to check against

Return values
array<string|int, mixed>|bool

Returns an array of the differences or FALSE if none

getMockedRequests()

Get all of the mocked requests

public getMockedRequests() : array<string|int, mixed>
Return values
array<string|int, mixed>

getMockResponse()

Get a mock response for a client by mock file name

public getMockResponse(string $path) : Response
Parameters
$path : string

Relative path to the mock response file

Return values
Response

getServer()

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

public static getServer() : Server
Return values
Server

setMockResponse()

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

public setMockResponse(Client $client, string $paths) : MockPlugin

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
$client : Client

Client object to modify

$paths : string

Path to files within the Mock folder of the service

Return values
MockPlugin

returns the created mock plugin

testAcceptsConfigurationData()

public testAcceptsConfigurationData() : mixed
Return values
mixed

testConvertsBooleansToStrings()

public testConvertsBooleansToStrings() : mixed
Tags
depends

testCreatesStringToSignFromPostRequest

Return values
mixed

testCreatesStringToSignFromPostRequest()

public testCreatesStringToSignFromPostRequest() : mixed
Return values
mixed

testCreatesStringToSignFromPostRequestWithCustomContentType()

public testCreatesStringToSignFromPostRequestWithCustomContentType() : mixed
Return values
mixed

testCreatesStringToSignFromPostRequestWithNullValues()

public testCreatesStringToSignFromPostRequestWithNullValues() : mixed
Return values
mixed

testCreatesStringToSignIgnoringPostFields()

public testCreatesStringToSignIgnoringPostFields() : mixed
Return values
mixed

testDoesNotAddFalseyValuesToAuthorization()

public testDoesNotAddFalseyValuesToAuthorization() : mixed
Return values
mixed

testInvalidArgumentExceptionOnMethodError()

public testInvalidArgumentExceptionOnMethodError() : mixed
Tags
expectedException

\InvalidArgumentException

Return values
mixed

testMultiDimensionalArray()

public testMultiDimensionalArray() : mixed
Tags
depends

testCreatesStringToSignFromPostRequest

Return values
mixed

testMultiDimensionalArrayWithNonDefaultQueryAggregator()

public testMultiDimensionalArrayWithNonDefaultQueryAggregator() : mixed
Tags
depends

testMultiDimensionalArray

Return values
mixed

testOptionalOauthParametersAreNotAutomaticallyAdded()

public testOptionalOauthParametersAreNotAutomaticallyAdded() : mixed
Return values
mixed

testSignsOauthQueryStringRequest()

public testSignsOauthQueryStringRequest() : mixed
Return values
mixed

testSignsOauthRequests()

Test that the Oauth is signed correctly and that extra strings haven't been added to the authorization header.

public testSignsOauthRequests() : mixed
Return values
mixed

testSignsStrings()

public testSignsStrings() : mixed
Tags
depends

testCreatesStringToSignFromPostRequest

Return values
mixed

testSubscribesToEvents()

public testSubscribesToEvents() : mixed
Return values
mixed

Search results