Documentation

MailChimpAPITest extends OAuth2ProviderLiveTestAbstract
in package

FinalYes

OAuth2 live API test

Attributes
#[Group]
'providerLiveTest'
#[Provider]
\chillerlan\OAuth\Providers\MailChimp::class

Table of Contents

Constants

CACERT  = self::PROJECT_ROOT . '/tests/cacert.pem'
CFGDIR  = self::PROJECT_ROOT . '/.config'
PROJECT_ROOT  = __DIR__ . '/../..'

Properties

$provider  : OAuthInterface|UserInfo
$provider  : OAuth2Interface
$provider  : MailChimp
$clientCredentialsScopes  : array<string|int, string>
$dotEnv  : DotEnv
$ENV_IS_CI  : bool
$ENV_PREFIX  : string
$HTTP_CLIENT_FACTORY  : string
$logger  : LoggerInterface
$options  : OAuthOptions
$provider  : OAuthInterface
$providerFactory  : OAuthProviderFactory
$reflection  : ReflectionObject
$storage  : OAuthStorageInterface
$TEST_USER  : string
a test username for live API tests, defined in `.env` as `<$provider::IDENTIFIER>_TESTUSER`

Methods

testGetTokenMetadata()  : void
testMe()  : void
testMeUnauthorizedAccessException()  : void
testRequestCredentialsToken()  : void
assertMeResponse()  : void
getMockHttpClient()  : ClientInterface
Creates a stupid simple `ClientInterface` that returns the given response instance
getProviderFQCN()  : string
Returns the fully qualified class name (FQCN) of the test subject
getReflectionProperty()  : mixed
Returns the current value of the given propertyin the current provider instance
getTestToken()  : AccessToken
Creates a test access token with the given parameters or a set of defaults
initConfig()  : void
Initializes the environment config (from `phpunit.xml`)
initOptions()  : OAuthOptions
Initializes an `OAuthOptions` instance
initStorage()  : OAuthStorageInterface
Initializes an `OAuthStorageInterface` instance
invokeReflectionMethod()  : mixed
Invokes a method vith the given arguments in the current provider instance
setMockResponse()  : void
Sets a custom response in the mock http client and sets the client in the current provider
setReflectionProperty()  : void
Sets a property in the current provider instance with the given value
setUp()  : void
Initializes the unit test

Constants

Properties

$HTTP_CLIENT_FACTORY

protected string $HTTP_CLIENT_FACTORY = \chillerlan\OAuthTest\Providers\ProviderLiveTestHttpClientFactory::class

$TEST_USER

a test username for live API tests, defined in `.env` as `<$provider::IDENTIFIER>_TESTUSER`

protected string $TEST_USER = ''

Methods

getMockHttpClient()

Creates a stupid simple `ClientInterface` that returns the given response instance

protected getMockHttpClient(ResponseInterface $response) : ClientInterface
Parameters
$response : ResponseInterface
Return values
ClientInterface

getProviderFQCN()

Returns the fully qualified class name (FQCN) of the test subject

protected final getProviderFQCN() : string
Tags
see
Provider
Return values
string

getReflectionProperty()

Returns the current value of the given propertyin the current provider instance

protected final getReflectionProperty(string $property) : mixed
Parameters
$property : string

getTestToken()

Creates a test access token with the given parameters or a set of defaults

protected getTestToken([array<string, scalar|null>|null $params = null ]) : AccessToken
Parameters
$params : array<string, scalar|null>|null = null
Return values
AccessToken

invokeReflectionMethod()

Invokes a method vith the given arguments in the current provider instance

protected final invokeReflectionMethod(string $method[, array<int, mixed> $args = [] ]) : mixed
Parameters
$method : string
$args : array<int, mixed> = []

setMockResponse()

Sets a custom response in the mock http client and sets the client in the current provider

protected setMockResponse(ResponseInterface|StreamInterface $response) : void
Parameters
$response : ResponseInterface|StreamInterface

setReflectionProperty()

Sets a property in the current provider instance with the given value

protected final setReflectionProperty(string $property, mixed $value) : void
Parameters
$property : string
$value : mixed

        
On this page

Search results