TestingProvider
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
Factory method
Protected constructor, see create method
Returns true if the given token can be authenticated by this provider
Returns the class names of the tokens this provider can authenticate.
Set the authentication status for authentication
Set the provider name
Reset the authentication status and account
Details
static AuthenticationProviderInterface
create(string $name, array $options)
Factory method
protected
__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