SilverStripe\GraphQL\Tests\Auth\HandlerTest
Synopsis
class HandlerTest
extends SapphireTest
{
- // members
- protected Handler $handler;
- // methods
- protected void setUp()
- public void testRequireAuthenticationReturnsFalseWhenNoneAreConfigured()
- public void testRequireAuthenticationReturnsMember()
- public void testGetAuthenticator()
- public void testExceptionThrownWhenAuthenticatorDoesNotImplementAuthenticatorInterface()
- public void testAuthenticatorsCanBePrioritised()
- public array prioritisedAuthenticatorProvider()
- public void testFailedAuthenticationThrowsException()
- public void testFailedAuthenticationWithFalsyReturnValueThrowsDefaultException()
Hierarchy
Extends
- SilverStripe\Dev\SapphireTest
Members
protected
- $handler — SilverStripe\GraphQL\Auth\Handler
Methods
protected
- setUp() — {@inheritDoc}
public
- prioritisedAuthenticatorProvider()
- testAuthenticatorsCanBePrioritised() — Test that authenticators can be prioritised and that priority is given a default value if not provided
- testExceptionThrownWhenAuthenticatorDoesNotImplementAuthenticatorInterface() — Test that an exception is thrown if an authenticator is configured that doesn't implement the interface
- testFailedAuthenticationThrowsException() — Ensure that an failed authentication attempt throws an exception
- testFailedAuthenticationWithFalsyReturnValueThrowsDefaultException() — Ensure that when a falsy value is returned from an authenticator (when it should throw an exception on failure) that a sensible default message is used in a ValidationException instead.
- testGetAuthenticator() — Ensure that an authenticator is returned when configured correctly
- testRequireAuthenticationReturnsFalseWhenNoneAreConfigured() — Ensure that nothing is done when no authenticators are configured
- testRequireAuthenticationReturnsMember() — Ensure that a successfully authenticated Member is returned by the Handler