UserFrosting API

AccountControllerTest extends TestCase Uses TestDatabase, RefreshDatabase, withTestUser, withController

Tests AccountController

Table of Contents

$initialized bool
$migrated bool
setUp() Setup test database for controller tests void
tearDown() void
testControllerConstructor() AccountController
testRegisterWithNoMasterUser() N.B.: Must be first test, before any master user is created mixed
testRegister() N.B.: Run this register second, as it's easier if no test user is present. mixed
testRegisterWithNoEmailVerification() mixed
performActualRegisterTest() mixed
testcheckUsername() mixed
testcheckUsernameWithNoData() mixed
testcheckUsernameWithUsernameNotAvailable() mixed
testcheckUsernameWithThrottler() mixed
testdenyResetPassword() mixed
testdenyResetPasswordWithFailedPasswordReset() mixed
testdenyResetPasswordWithFailedValidation() mixed
testforgotPassword() N.B.: This test is incomplete as it doesn't actually check if repoPasswordReset returns the correct info and the message contains the right content mixed
testforgotPasswordWithFailedValidation() mixed
testforgotPasswordWithThrottler() mixed
testgetModalAccountTos() mixed
testimageCaptcha() mixed
testlogin() mixed
testloginWithEmail() mixed
testloginWithLoggedInUser() mixed
testloginWithFailledValidation() mixed
testloginWithThrottler() mixed
testloginThrottlerCountsFailedLogins() mixed
testloginThrottlerDoesntCountSuccessfulLogins() mixed
testloginWithDisableEmail() mixed
testlogoutWithLoggedInUser() mixed
testlogoutWithNoUser() mixed
testpageForgotPassword() mixed
testpageRegister() mixed
testpageRegisterWithDisabledRegistration() mixed
testpageRegisterWithNoLocales() mixed
testpageRegisterWithLoggedInUser() mixed
testpageResendVerification() mixed
testpageResetPassword() mixed
testpageSetPassword() mixed
testpageSettings() mixed
testpageSettingsWithPartialPermissions() mixed
actualpageSettings() mixed
testpageSettingsWithNoPermissions() mixed
testpageSignIn() mixed
testpageSignInWithLoggedInUser() mixed
testProfile() mixed
testProfileWithPartialPermissions() mixed
performActualProfileTests() mixed
testProfileWithNoPermissions() mixed
testProfileWithFailedValidation() mixed
testProfileWithInvalidLocale() mixed
testRegisterWithHoneypot() mixed
testRegisterWithRegistrationDisabled() mixed
testRegisterWithLoggedInUser() mixed
testRegisterWithFailedThrottle() mixed
testRegisterWithFailedCaptcha() mixed
testRegisterWithFailedValidation() mixed
testresendVerification() mixed
testresendVerificationWithVerifiedUser() mixed
testresendVerificationWithFailedThrottle() mixed
testresendVerificationWithFailedValidation() mixed
testSetPassword() mixed
testSetPasswordWithNoToken() mixed
testsetPasswordWithFailedValidation() mixed
testSettings() mixed
testSettingsOnlyEmailNoLocale() mixed
testSettingsWithNoPermissions() mixed
testSettingsWithFailedValidation() mixed
testSettingsWithFailedPasswordCheck() mixed
testSettingsWithEmailInUse() mixed
testSuggestUsername() mixed
testVerify() mixed
testVerifyWithFailedVerification() mixed
testVerifyWithFailedValidation() mixed
getController() AccountController
setupTestDatabase() Define the test_integration database connection the default one mixed
refreshDatabase() Define hooks to migrate the database before and after each test. mixed
usingInMemoryDatabase() Determine if an in-memory database is being used. bool
refreshInMemoryDatabase() Refresh the in-memory database. mixed
refreshTestDatabase() Refresh a conventional test database. mixed
beginDatabaseTransaction() Handle database transactions on the specified connections. mixed
connectionsToTransact() The database connections that should have transactions. array
loginUser() mixed
logoutCurrentUser() Logout mixed
createTestUser() Create a test user with no settings/permissions for a controller test User
getRandomUserId() Returns a random user id, exclusing th master id int
giveUserTestPermission() Gives a user a new test permission Permission
giveUserPermission() Add the test permission to a Role, then the role to the user Role
getRequest() Request
getResponse() Response

Properties

Methods

testRegisterWithNoMasterUser()

N.B.: Must be first test, before any master user is created

public testRegisterWithNoMasterUser( $controller : AccountController ) : mixed
Parameters
$controller : AccountController
Tags
depends

testControllerConstructor

Return values
mixed

testRegister()

N.B.: Run this register second, as it's easier if no test user is present.

public testRegister( ) : mixed
Tags
depends

testControllerConstructor

see
RegistrationTest

for complete registration exception (for example duplicate email) testing

Return values
mixed

testRegisterWithNoEmailVerification()

public testRegisterWithNoEmailVerification( ) : mixed
Tags
depends

testControllerConstructor

depends

testRegister

Return values
mixed

testcheckUsernameWithUsernameNotAvailable()

public testcheckUsernameWithUsernameNotAvailable( $controller : AccountController ) : mixed
Parameters
$controller : AccountController
Tags
depends

testControllerConstructor

depends

testcheckUsername

Return values
mixed

testcheckUsernameWithThrottler()

public testcheckUsernameWithThrottler( ) : mixed
Tags
depends

testControllerConstructor

depends

testcheckUsername

Return values
mixed

testdenyResetPassword()

public testdenyResetPassword( ) : mixed
Tags
depends

testControllerConstructor

Return values
mixed

testdenyResetPasswordWithFailedPasswordReset()

public testdenyResetPasswordWithFailedPasswordReset( ) : mixed
Tags
depends

testControllerConstructor

depends

testdenyResetPassword

Return values
mixed

testdenyResetPasswordWithFailedValidation()

public testdenyResetPasswordWithFailedValidation( $controller : AccountController ) : mixed
Parameters
$controller : AccountController
Tags
depends

testControllerConstructor

depends

testdenyResetPassword

Return values
mixed

testforgotPassword()

N.B.: This test is incomplete as it doesn't actually check if repoPasswordReset returns the correct info and the message contains the right content

public testforgotPassword( ) : mixed
Tags
depends

testControllerConstructor

Return values
mixed

testforgotPasswordWithThrottler()

public testforgotPasswordWithThrottler( ) : mixed
Tags
depends

testControllerConstructor

depends

testforgotPassword

Return values
mixed

testloginWithThrottler()

public testloginWithThrottler( ) : mixed
Tags
depends

testControllerConstructor

Return values
mixed

testloginThrottlerCountsFailedLogins()

public testloginThrottlerCountsFailedLogins( ) : mixed
Tags
depends

testControllerConstructor

Return values
mixed

testloginThrottlerDoesntCountSuccessfulLogins()

public testloginThrottlerDoesntCountSuccessfulLogins( ) : mixed
Tags
depends

testControllerConstructor

Return values
mixed

testloginWithDisableEmail()

public testloginWithDisableEmail( ) : mixed
Tags
depends

testControllerConstructor

Return values
mixed

testlogoutWithLoggedInUser()

public testlogoutWithLoggedInUser( ) : mixed
Tags
depends

testControllerConstructor

Return values
mixed

testpageRegisterWithDisabledRegistration()

public testpageRegisterWithDisabledRegistration( ) : mixed
Tags
depends

testControllerConstructor

depends

testpageRegister

Return values
mixed

testpageRegisterWithNoLocales()

public testpageRegisterWithNoLocales( ) : mixed
Tags
depends

testControllerConstructor

depends

testpageRegister

Return values
mixed

testpageRegisterWithLoggedInUser()

public testpageRegisterWithLoggedInUser( ) : mixed
Tags
depends

testControllerConstructor

depends

testpageRegister

Return values
mixed

testpageSettings()

public testpageSettings( ) : mixed
Tags
depends

testControllerConstructor

Return values
mixed

testpageSettingsWithPartialPermissions()

public testpageSettingsWithPartialPermissions( ) : mixed
Tags
depends

testControllerConstructor

depends

testpageSettings

Return values
mixed

testpageSignInWithLoggedInUser()

public testpageSignInWithLoggedInUser( ) : mixed
Tags
depends

testControllerConstructor

depends

testpageSignIn

Return values
mixed

testProfile()

public testProfile( ) : mixed
Tags
depends

testControllerConstructor

Return values
mixed

testProfileWithPartialPermissions()

public testProfileWithPartialPermissions( ) : mixed
Tags
depends

testControllerConstructor

depends

testProfile

Return values
mixed

testProfileWithFailedValidation()

public testProfileWithFailedValidation( ) : mixed
Tags
depends

testControllerConstructor

depends

testProfile

Return values
mixed

testProfileWithInvalidLocale()

public testProfileWithInvalidLocale( ) : mixed
Tags
depends

testControllerConstructor

depends

testProfile

Return values
mixed

testRegisterWithLoggedInUser()

public testRegisterWithLoggedInUser( ) : mixed
Tags
depends

testControllerConstructor

Return values
mixed

testRegisterWithFailedThrottle()

public testRegisterWithFailedThrottle( ) : mixed
Tags
depends

testControllerConstructor

depends

testRegisterWithLoggedInUser

Return values
mixed

testresendVerification()

public testresendVerification( ) : mixed
Tags
depends

testControllerConstructor

Return values
mixed

testresendVerificationWithVerifiedUser()

public testresendVerificationWithVerifiedUser( ) : mixed
Tags
depends

testControllerConstructor

depends

testresendVerification

Return values
mixed

testresendVerificationWithFailedThrottle()

public testresendVerificationWithFailedThrottle( ) : mixed
Tags
depends

testControllerConstructor

depends

testresendVerification

Return values
mixed

testresendVerificationWithFailedValidation()

public testresendVerificationWithFailedValidation( $controller : AccountController ) : mixed
Parameters
$controller : AccountController
Tags
depends

testControllerConstructor

depends

testresendVerification

Return values
mixed

testSetPassword()

public testSetPassword( ) : mixed
Tags
depends

testControllerConstructor

Return values
mixed

testSettings()

public testSettings( ) : mixed
Tags
depends

testControllerConstructor

Return values
mixed

testSettingsOnlyEmailNoLocale()

public testSettingsOnlyEmailNoLocale( ) : mixed
Tags
depends

testControllerConstructor

depends

testSettings

Return values
mixed

testSettingsWithNoPermissions()

public testSettingsWithNoPermissions( ) : mixed
Tags
depends

testControllerConstructor

depends

testSettings

Return values
mixed

testSettingsWithFailedValidation()

public testSettingsWithFailedValidation( ) : mixed
Tags
depends

testControllerConstructor

depends

testSettings

Return values
mixed

testSettingsWithFailedPasswordCheck()

public testSettingsWithFailedPasswordCheck( ) : mixed
Tags
depends

testControllerConstructor

depends

testSettings

Return values
mixed

testSettingsWithEmailInUse()

public testSettingsWithEmailInUse( ) : mixed
Tags
depends

testControllerConstructor

depends

testSettings

Return values
mixed

testVerify()

public testVerify( ) : mixed
Tags
depends

testControllerConstructor

Return values
mixed

testVerifyWithFailedVerification()

public testVerifyWithFailedVerification( ) : mixed
Tags
depends

testControllerConstructor

depends

testVerify

Return values
mixed

testVerifyWithFailedValidation()

public testVerifyWithFailedValidation( ) : mixed
Tags
depends

testControllerConstructor

depends

testVerify

Return values
mixed

setupTestDatabase()

Define the test_integration database connection the default one

public setupTestDatabase( ) : mixed
Return values
mixed

refreshDatabase()

Define hooks to migrate the database before and after each test.

public refreshDatabase( ) : mixed
Return values
mixed

usingInMemoryDatabase()

Determine if an in-memory database is being used.

public usingInMemoryDatabase( ) : bool
Return values
bool

refreshInMemoryDatabase()

Refresh the in-memory database.

protected refreshInMemoryDatabase( ) : mixed
Return values
mixed

refreshTestDatabase()

Refresh a conventional test database.

protected refreshTestDatabase( ) : mixed
Return values
mixed

beginDatabaseTransaction()

Handle database transactions on the specified connections.

protected beginDatabaseTransaction( ) : mixed
Return values
mixed

connectionsToTransact()

The database connections that should have transactions.

protected connectionsToTransact( ) : array
Return values
array

logoutCurrentUser()

Logout

protected logoutCurrentUser( ) : mixed
Return values
mixed

createTestUser()

Create a test user with no settings/permissions for a controller test

protected createTestUser( [ $isMaster : bool = false ] [, $login : bool = false ] [, $params : array = [] ] ) : User
Parameters
$isMaster : bool = false

Does this user have root access? Will bypass all permissions

$login : bool = false

Login this user, setting him as the currentUser

$params : array = []

User account params

Return values
User

getRandomUserId()

Returns a random user id, exclusing th master id

protected getRandomUserId( $masterId : int ) : int
Parameters
$masterId : int
Return values
int

giveUserTestPermission()

Gives a user a new test permission

protected giveUserTestPermission( $user : UserInterface , $slug : string [, $conditions : string = 'always()' ] ) : Permission
Parameters
$user : UserInterface
$slug : string
$conditions : string = 'always()'
Return values
Permission

getRequest()

protected getRequest( [ $args : array = [] ] ) : Request
Parameters
$args : array = []

Request arguments

Return values
Request

getResponse()

protected getResponse( ) : Response
Return values
Response

Search results