UserControllerTest extends TestCase Uses TestDatabase, RefreshDatabase, withTestUser, withController
Tests UserController
Table of Contents
Properties
$initialized
protected
static bool
$initialized
= false
$migrated
public
static bool
$migrated
= false
Methods
setUp()
Setup test database for controller tests
public
setUp(
)
: void
tearDown()
public
tearDown(
)
: void
testControllerConstructor()
public
testControllerConstructor(
)
: mixed
Return values
mixedtestControllerConstructorWithUser()
public
testControllerConstructorWithUser(
)
: UserController
Tags
Return values
UserControllertestCreateWithNoUsername()
public
testCreateWithNoUsername(
$controller :
UserController
)
: mixed
Parameters
- $controller : UserController
Tags
Return values
mixedtestCreateWithNoEmail()
public
testCreateWithNoEmail(
$controller :
UserController
)
: mixed
Parameters
- $controller : UserController
Tags
Return values
mixedtestCreateWithDuplicateUsername()
public
testCreateWithDuplicateUsername(
$controller :
UserController
)
: mixed
Parameters
- $controller : UserController
Tags
Return values
mixedtestCreateWithDuplicateEmail()
public
testCreateWithDuplicateEmail(
$controller :
UserController
)
: mixed
Parameters
- $controller : UserController
Tags
Return values
mixedtestCreatePasswordReset()
public
testCreatePasswordReset(
)
: mixed
Tags
Return values
mixedtestCreatePasswordResetWithNotExistingUser()
public
testCreatePasswordResetWithNotExistingUser(
$controller :
UserController
)
: mixed
Parameters
- $controller : UserController
Tags
Return values
mixedtestDelete()
public
testDelete(
$controller :
UserController
)
: mixed
Parameters
- $controller : UserController
Tags
Return values
mixedtestDeleteWithNotExistingUser()
public
testDeleteWithNotExistingUser(
$controller :
UserController
)
: mixed
Parameters
- $controller : UserController
Tags
Return values
mixedtestDeleteWithReservedIds()
public
testDeleteWithReservedIds(
$controller :
UserController
)
: mixed
Parameters
- $controller : UserController
Tags
Return values
mixedtestGetActivities()
public
testGetActivities(
$controller :
UserController
)
: mixed
Parameters
- $controller : UserController
Tags
Return values
mixedtestGetActivitiesWithBadUser()
public
testGetActivitiesWithBadUser(
$controller :
UserController
)
: mixed
Parameters
- $controller : UserController
Tags
Return values
mixedtestGetInfo()
public
testGetInfo(
$controller :
UserController
)
: mixed
Parameters
- $controller : UserController
Tags
Return values
mixedtestGetInfoWithBadUser()
public
testGetInfoWithBadUser(
$controller :
UserController
)
: mixed
Parameters
- $controller : UserController
Tags
Return values
mixedtestGetList()
public
testGetList(
$controller :
UserController
)
: mixed
Parameters
- $controller : UserController
Tags
Return values
mixedtestGetModalConfirmDelete()
public
testGetModalConfirmDelete(
$controller :
UserController
)
: mixed
Parameters
- $controller : UserController
Tags
Return values
mixedtestGetModalConfirmDeleteWithNoUser()
public
testGetModalConfirmDeleteWithNoUser(
$controller :
UserController
)
: mixed
Parameters
- $controller : UserController
Tags
Return values
mixedtestGetModalConfirmDeleteWithNonExistingUser()
public
testGetModalConfirmDeleteWithNonExistingUser(
$controller :
UserController
)
: mixed
Parameters
- $controller : UserController
Tags
Return values
mixedtestGetModalConfirmDeleteWithReservedId()
public
testGetModalConfirmDeleteWithReservedId(
$controller :
UserController
)
: mixed
Parameters
- $controller : UserController
Tags
Return values
mixedtestGetModalCreate()
public
testGetModalCreate(
$controller :
UserController
)
: mixed
Parameters
- $controller : UserController
Tags
Return values
mixedtestGetModalCreateWithNoLocale()
public
testGetModalCreateWithNoLocale(
$controller :
UserController
)
: mixed
Parameters
- $controller : UserController
Tags
Return values
mixedtestGetModalEdit()
public
testGetModalEdit(
$controller :
UserController
)
: mixed
Parameters
- $controller : UserController
Tags
Return values
mixedtestGetModalEditWithNoLocale()
public
testGetModalEditWithNoLocale(
$controller :
UserController
)
: mixed
Parameters
- $controller : UserController
Tags
Return values
mixedtestGetModalEditWithNoUser()
public
testGetModalEditWithNoUser(
$controller :
UserController
)
: mixed
Parameters
- $controller : UserController
Tags
Return values
mixedtestGetModalEditPassword()
public
testGetModalEditPassword(
$controller :
UserController
)
: mixed
Parameters
- $controller : UserController
Tags
Return values
mixedtestGetModalEditPasswordWithNoUser()
public
testGetModalEditPasswordWithNoUser(
$controller :
UserController
)
: mixed
Parameters
- $controller : UserController
Tags
Return values
mixedtestGetModalEditRoles()
public
testGetModalEditRoles(
$controller :
UserController
)
: mixed
Parameters
- $controller : UserController
Tags
Return values
mixedtestGetModalEditRolesWithNoUser()
public
testGetModalEditRolesWithNoUser(
$controller :
UserController
)
: mixed
Parameters
- $controller : UserController
Tags
Return values
mixedtestGetPermissions()
public
testGetPermissions(
$controller :
UserController
)
: mixed
Parameters
- $controller : UserController
Tags
Return values
mixedtestGetPermissionsWithNoUser()
public
testGetPermissionsWithNoUser(
$controller :
UserController
)
: mixed
Parameters
- $controller : UserController
Tags
Return values
mixedtestGetRoles()
public
testGetRoles(
$controller :
UserController
)
: mixed
Parameters
- $controller : UserController
Tags
Return values
mixedtestGetRolesWithNoUser()
public
testGetRolesWithNoUser(
$controller :
UserController
)
: mixed
Parameters
- $controller : UserController
Tags
Return values
mixedtestPageInfo()
public
testPageInfo(
$controller :
UserController
)
: mixed
Parameters
- $controller : UserController
Tags
Return values
mixedtestPageInfoWithNoLocale()
public
testPageInfoWithNoLocale(
$controller :
UserController
)
: mixed
Parameters
- $controller : UserController
Tags
Return values
mixedtestPageInfoWithNoUser()
public
testPageInfoWithNoUser(
$controller :
UserController
)
: mixed
Parameters
- $controller : UserController
Tags
Return values
mixedtestPageList()
public
testPageList(
$controller :
UserController
)
: mixed
Parameters
- $controller : UserController
Tags
Return values
mixedtestUpdateInfo()
public
testUpdateInfo(
$controller :
UserController
)
: mixed
Parameters
- $controller : UserController
Tags
Return values
mixedtestUpdateInfoWithNoUser()
public
testUpdateInfoWithNoUser(
$controller :
UserController
)
: mixed
Parameters
- $controller : UserController
Tags
Return values
mixedtestUpdateInfoWithValidationError()
public
testUpdateInfoWithValidationError(
$controller :
UserController
)
: mixed
Parameters
- $controller : UserController
Tags
Return values
mixedtestUpdateInfoWithDuplicateEmail()
public
testUpdateInfoWithDuplicateEmail(
$controller :
UserController
)
: mixed
Parameters
- $controller : UserController
Tags
Return values
mixedtestUpdateInfoForMasterUser()
public
testUpdateInfoForMasterUser(
$controller :
UserController
)
: mixed
Parameters
- $controller : UserController
Tags
Return values
mixedtestUpdateField()
public
testUpdateField(
$controller :
UserController
)
: mixed
Parameters
- $controller : UserController
Tags
Return values
mixedtestUpdateFieldWithDeprecatedSupport()
public
testUpdateFieldWithDeprecatedSupport(
$controller :
UserController
)
: mixed
Parameters
- $controller : UserController
Tags
Return values
mixedtestUpdateFieldWithNoUser()
public
testUpdateFieldWithNoUser(
$controller :
UserController
)
: mixed
Parameters
- $controller : UserController
Tags
Return values
mixedtestUpdateFieldWithNoUserWithNoValue()
public
testUpdateFieldWithNoUserWithNoValue(
$controller :
UserController
)
: mixed
Parameters
- $controller : UserController
Tags
Return values
mixedtestUpdateFieldWithMasterUser()
public
testUpdateFieldWithMasterUser(
$controller :
UserController
)
: mixed
Parameters
- $controller : UserController
Tags
Return values
mixedtestUpdateFieldWithValidationError()
public
testUpdateFieldWithValidationError(
$controller :
UserController
)
: mixed
Parameters
- $controller : UserController
Tags
Return values
mixedtestUpdateFieldForFlagEnabled()
public
testUpdateFieldForFlagEnabled(
$controller :
UserController
)
: mixed
Parameters
- $controller : UserController
Tags
Return values
mixedtestUpdateFieldForFlagEnabledDisabled()
public
testUpdateFieldForFlagEnabledDisabled(
$controller :
UserController
)
: mixed
Parameters
- $controller : UserController
Tags
Return values
mixedtestUpdateFieldForFlagVerified()
public
testUpdateFieldForFlagVerified(
$controller :
UserController
)
: mixed
Parameters
- $controller : UserController
Tags
Return values
mixedtestUpdateFieldForFlagEnabledWithMasterUser()
public
testUpdateFieldForFlagEnabledWithMasterUser(
$controller :
UserController
)
: mixed
Parameters
- $controller : UserController
Tags
Return values
mixedtestUpdateFieldForPassword()
public
testUpdateFieldForPassword(
$controller :
UserController
)
: mixed
Parameters
- $controller : UserController
Tags
Return values
mixedtestUpdateFieldForRoles()
public
testUpdateFieldForRoles(
$controller :
UserController
)
: mixed
Parameters
- $controller : UserController
Tags
Return values
mixedgetController()
private
getController(
)
: UserController
Return values
UserControllersetupUser()
private
setupUser(
)
: mixed
Return values
mixedsetupTestDatabase()
Define the test_integration database connection the default one
public
setupTestDatabase(
)
: mixed
Return values
mixedrefreshDatabase()
Define hooks to migrate the database before and after each test.
public
refreshDatabase(
)
: mixed
Return values
mixedusingInMemoryDatabase()
Determine if an in-memory database is being used.
public
usingInMemoryDatabase(
)
: bool
Return values
boolrefreshInMemoryDatabase()
Refresh the in-memory database.
protected
refreshInMemoryDatabase(
)
: mixed
Return values
mixedrefreshTestDatabase()
Refresh a conventional test database.
protected
refreshTestDatabase(
)
: mixed
Return values
mixedbeginDatabaseTransaction()
Handle database transactions on the specified connections.
protected
beginDatabaseTransaction(
)
: mixed
Return values
mixedconnectionsToTransact()
The database connections that should have transactions.
protected
connectionsToTransact(
)
: array
Return values
arrayloginUser()
protected
loginUser(
$user :
UserInterface
)
: mixed
Parameters
- $user : UserInterface
Return values
mixedlogoutCurrentUser()
Logout
protected
logoutCurrentUser(
)
: mixed
Return values
mixedcreateTestUser()
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
UsergetRandomUserId()
Returns a random user id, exclusing th master id
protected
getRandomUserId(
$masterId :
int
)
: int
Parameters
- $masterId : int
Return values
intgiveUserTestPermission()
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
PermissiongiveUserPermission()
Add the test permission to a Role, then the role to the user
protected
giveUserPermission(
$user :
UserInterface
, $permission :
Permission
)
: Role
Parameters
- $user : UserInterface
- $permission : Permission
Return values
Role —The intermidiate role
getRequest()
protected
getRequest(
[ $args :
array
= [] ]
)
: Request
Parameters
- $args : array = []
Request arguments
Return values
RequestgetResponse()
protected
getResponse(
)
: Response