SilverStripe\MFA\Tests\Authenticator\RegisterHandlerTest
Class RegisterHandlerTest
Synopsis
class RegisterHandlerTest
extends FunctionalTest
{
- // constants
- const URL = 'Security/login/default/mfa/register/basic-math/';
- // members
- protected static string $fixture_file = 'RegisterHandlerTest.yml';
- // methods
- protected void setUp()
- public void testRegisterRouteIsPrivateWithGETMethod()
- public void testRegisterRouteIsPrivateWithPOSTMethod()
- public void testStartRegistrationFailsWhenInvalidMethodIsPassed()
- public void testStartRegistrationFailsWhenRegisteredMethodExists()
- public void testStartRegistrationFailsWhenMethodIsAlreadyRegistered()
- public void testStartRegistrationSucceeds()
- public void testStartRegistrationProvidesACSRFToken()
- public void testFinishRegistrationFailsWhenCalledDirectly()
- public void testFinishRegistrationFailsWhenMethodIsMismatched()
- public void testFinishRegistrationFailsWhenMethodCannotBeRegistered()
- public void testFinishRegistrationSucceeds()
- public void testFinishRegistrationValidatesCSRF()
- public void testEnforcesSudoMode()
- protected void scaffoldPartialLogin()
Hierarchy
Extends
- SilverStripe\Dev\FunctionalTest
Constants
Name | Value |
---|---|
URL | 'Security/login/default/mfa/register/basic-math/' |
Members
protected
- $fixture_file
Methods
protected
- scaffoldPartialLogin() — Mark the given user as partially logged in - ie. they've entered their email/password and are currently going through the MFA process
- setUp()
public
- testEnforcesSudoMode()
- testFinishRegistrationFailsWhenCalledDirectly() — Tests that the start registration step must be called before the completion step
- testFinishRegistrationFailsWhenMethodCannotBeRegistered()
- testFinishRegistrationFailsWhenMethodIsMismatched() — Tests that a nefarious user can't change the method they're registering halfway through
- testFinishRegistrationSucceeds() — Assuming the member passed the above checks, tests that the member can complete a registration attempt
- testFinishRegistrationValidatesCSRF()
- testRegisterRouteIsPrivateWithGETMethod() — Tests that the registration flow can't be started without being logged in (or past basic auth)
- testRegisterRouteIsPrivateWithPOSTMethod() — Tests that the registration flow can't be finished without being logged in (or past basic auth)
- testStartRegistrationFailsWhenInvalidMethodIsPassed() — Tests that a member can't register a new method during login if they've already registered one before
- testStartRegistrationFailsWhenMethodIsAlreadyRegistered() — Tests that a member can't register the same method twice
- testStartRegistrationFailsWhenRegisteredMethodExists() — Tests that a member can't register a new method during login if they've already registered one before
- testStartRegistrationProvidesACSRFToken()
- testStartRegistrationSucceeds() — Assuming the member passed the above checks, tests that the member can get context for registering a method