UserControllerGuestTest 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
UserControllertestCreateWithNoPermissions()
public
testCreateWithNoPermissions(
$controller :
UserController
)
: mixed
Parameters
- $controller : UserController
Tags
Return values
mixedtestCreateWithNoGroupPermissions()
public
testCreateWithNoGroupPermissions(
)
: mixed
Tags
Return values
mixedtestCreatePasswordResetWithNoPermissions()
public
testCreatePasswordResetWithNoPermissions(
$controller :
UserController
)
: mixed
Parameters
- $controller : UserController
Tags
Return values
mixedtestCreatePasswordResetWithPartialPermissions()
public
testCreatePasswordResetWithPartialPermissions(
$controller :
UserController
)
: mixed
Parameters
- $controller : UserController
Tags
Return values
mixedtestDeleteWithNoPermission()
public
testDeleteWithNoPermission(
$controller :
UserController
)
: mixed
Parameters
- $controller : UserController
Tags
Return values
mixedtestGetActivitiesWithNoPermission()
public
testGetActivitiesWithNoPermission(
$controller :
UserController
)
: mixed
Parameters
- $controller : UserController
Tags
Return values
mixedtestGetActivitiesWithPartialPermission()
public
testGetActivitiesWithPartialPermission(
$controller :
UserController
)
: mixed
Parameters
- $controller : UserController
Tags
Return values
mixedtestGetInfoWithNoPermission()
public
testGetInfoWithNoPermission(
$controller :
UserController
)
: mixed
Parameters
- $controller : UserController
Tags
Return values
mixedtestGetInfoWithPartialPermission()
public
testGetInfoWithPartialPermission(
$controller :
UserController
)
: mixed
Parameters
- $controller : UserController
Tags
Return values
mixedtestGetListWithNoPermission()
public
testGetListWithNoPermission(
$controller :
UserController
)
: mixed
Parameters
- $controller : UserController
Tags
Return values
mixedtestGetModalConfirmDeleteWithNoPermission()
public
testGetModalConfirmDeleteWithNoPermission(
$controller :
UserController
)
: mixed
Parameters
- $controller : UserController
Tags
Return values
mixedtestGetModalCreateWithNoPermission()
public
testGetModalCreateWithNoPermission(
$controller :
UserController
)
: mixed
Parameters
- $controller : UserController
Tags
Return values
mixedtestGetModalCreateWithNoUserGroup()
public
testGetModalCreateWithNoUserGroup(
$controller :
UserController
)
: mixed
Parameters
- $controller : UserController
Tags
Return values
mixedtestGetModalEditWithNoPermissions()
public
testGetModalEditWithNoPermissions(
$controller :
UserController
)
: mixed
Parameters
- $controller : UserController
Tags
Return values
mixedtestGetModalEditWithPartialPermissions()
public
testGetModalEditWithPartialPermissions(
$controller :
UserController
)
: mixed
Parameters
- $controller : UserController
Tags
Return values
mixedtestGetModalEditWithNoGroupPermissions()
public
testGetModalEditWithNoGroupPermissions(
$controller :
UserController
)
: mixed
Parameters
- $controller : UserController
Tags
Return values
mixedtestGetModalEditPasswordWithNoPermissions()
public
testGetModalEditPasswordWithNoPermissions(
$controller :
UserController
)
: mixed
Parameters
- $controller : UserController
Tags
Return values
mixedtestGetModalEditPasswordWithPartialPermissions()
public
testGetModalEditPasswordWithPartialPermissions(
$controller :
UserController
)
: mixed
Parameters
- $controller : UserController
Tags
Return values
mixedtestGetModalEditRolesWithNoPermission()
public
testGetModalEditRolesWithNoPermission(
$controller :
UserController
)
: mixed
Parameters
- $controller : UserController
Tags
Return values
mixedtestGetPermissionsWithNoPermissions()
public
testGetPermissionsWithNoPermissions(
$controller :
UserController
)
: mixed
Parameters
- $controller : UserController
Tags
Return values
mixedtestGetPermissionsWithPartialPermissions()
public
testGetPermissionsWithPartialPermissions(
$controller :
UserController
)
: mixed
Parameters
- $controller : UserController
Tags
Return values
mixedtestGetRolesWithNoPermissions()
public
testGetRolesWithNoPermissions(
$controller :
UserController
)
: mixed
Parameters
- $controller : UserController
Tags
Return values
mixedtestGetRolesWithPartialPermissions()
public
testGetRolesWithPartialPermissions(
$controller :
UserController
)
: mixed
Parameters
- $controller : UserController
Tags
Return values
mixedtestPageInfoWithNoPermissions()
public
testPageInfoWithNoPermissions(
$controller :
UserController
)
: mixed
Parameters
- $controller : UserController
Tags
Return values
mixedtestPageInfoWithPartialPermissions()
public
testPageInfoWithPartialPermissions(
$controller :
UserController
)
: mixed
Parameters
- $controller : UserController
Tags
Return values
mixedtestPageListWithNoPermission()
public
testPageListWithNoPermission(
$controller :
UserController
)
: mixed
Parameters
- $controller : UserController
Tags
Return values
mixedtestUpdateInfoWithNoPermissions()
public
testUpdateInfoWithNoPermissions(
$controller :
UserController
)
: mixed
Parameters
- $controller : UserController
Tags
Return values
mixedtestUpdateInfoWithPartialPermissions()
public
testUpdateInfoWithPartialPermissions(
$controller :
UserController
)
: mixed
Parameters
- $controller : UserController
Tags
Return values
mixedtestUpdateInfoForMasterUserWithNoPermissions()
public
testUpdateInfoForMasterUserWithNoPermissions(
$controller :
UserController
)
: mixed
Parameters
- $controller : UserController
Tags
Return values
mixedtestUpdateFieldWithNoPermissions()
public
testUpdateFieldWithNoPermissions(
$controller :
UserController
)
: mixed
Parameters
- $controller : UserController
Tags
Return values
mixedtestUpdateFieldWithPartialPermissions()
public
testUpdateFieldWithPartialPermissions(
$controller :
UserController
)
: mixed
Parameters
- $controller : UserController
Tags
Return values
mixedtestUpdateFieldWithMasterUserWithNoPermissions()
public
testUpdateFieldWithMasterUserWithNoPermissions(
$controller :
UserController
)
: mixed
Parameters
- $controller : UserController
Tags
Return values
mixedtestUpdateFieldForFlagEnabledWithCurrentUser()
public
testUpdateFieldForFlagEnabledWithCurrentUser(
$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