class TestingProvider extends AbstractProvider (View source)

A singleton authentication provider for functional tests with mockable authentication.

Properties

protected string $name from  AbstractProvider
protected array $options from  AbstractProvider
protected Account $account
protected int $authenticationStatus

Methods

create(string $name, array $options)

Factory method

__construct(string $name, array $options = [])

Protected constructor, see create method

bool
canAuthenticate(TokenInterface $authenticationToken)

Returns true if the given token can be authenticated by this provider

array
getTokenClassNames()

Returns the class names of the tokens this provider can authenticate.

void
authenticate(TokenInterface $authenticationToken)

Sets isAuthenticated to true for all tokens.

void
setAccount(Account $account)

Set the account that will be authenticated

void
setAuthenticationStatus(int $authenticationStatus)

Set the authentication status for authentication

void
setName(string $name)

Set the provider name

void
reset()

Reset the authentication status and account

Details

static AuthenticationProviderInterface create(string $name, array $options)

Factory method

Parameters

string $name
array $options

Return Value

AuthenticationProviderInterface

protected __construct(string $name, array $options = [])

Protected constructor, see create method

Parameters

string $name

The name of this authentication provider

array $options

Additional configuration options

See also

create

bool canAuthenticate(TokenInterface $authenticationToken)

Returns true if the given token can be authenticated by this provider

Parameters

TokenInterface $authenticationToken

The token that should be authenticated

Return Value

bool

true if the given token class can be authenticated by this provider

array getTokenClassNames()

Returns the class names of the tokens this provider can authenticate.

Return Value

array

The classname of the token this provider is responsible for

void authenticate(TokenInterface $authenticationToken)

Sets isAuthenticated to true for all tokens.

Parameters

TokenInterface $authenticationToken

The token to be authenticated

Return Value

void

void setAccount(Account $account)

Set the account that will be authenticated

Parameters

Account $account

Return Value

void

void setAuthenticationStatus(int $authenticationStatus)

Set the authentication status for authentication

Parameters

int $authenticationStatus

Return Value

void

void setName(string $name)

Set the provider name

Parameters

string $name

Return Value

void

void reset()

Reset the authentication status and account

Return Value

void