RoleControllerTest extends TestCase Uses TestDatabase, RefreshDatabase, withTestUser, withController
Tests RoleController
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
testControllerConstructor()
public
testControllerConstructor(
)
: mixed
Return values
mixedtestControllerConstructorWithUser()
public
testControllerConstructorWithUser(
)
: RoleController
Tags
Return values
RoleControllertestCreate()
public
testCreate(
$controller :
RoleController
)
: mixed
Parameters
- $controller : RoleController
Tags
Return values
mixedtestCreateWithMissingName()
public
testCreateWithMissingName(
$controller :
RoleController
)
: mixed
Parameters
- $controller : RoleController
Tags
Return values
mixedtestCreateWithDuplicateSlug()
public
testCreateWithDuplicateSlug(
$controller :
RoleController
)
: mixed
Parameters
- $controller : RoleController
Tags
Return values
mixedtestCreateWithDuplicateName()
public
testCreateWithDuplicateName(
$controller :
RoleController
)
: mixed
Parameters
- $controller : RoleController
Tags
Return values
mixedtestDelete()
public
testDelete(
$controller :
RoleController
)
: mixed
Parameters
- $controller : RoleController
Tags
Return values
mixedtestDeleteWithNotExistingRole()
public
testDeleteWithNotExistingRole(
$controller :
RoleController
)
: mixed
Parameters
- $controller : RoleController
Tags
Return values
mixedtestDeleteWithDefaultRole()
public
testDeleteWithDefaultRole(
$controller :
RoleController
)
: mixed
Parameters
- $controller : RoleController
Tags
Return values
mixedtestDeleteWithUserInRole()
public
testDeleteWithUserInRole(
$controller :
RoleController
)
: mixed
Parameters
- $controller : RoleController
Tags
Return values
mixedtestGetInfoWithNotFoundException()
public
testGetInfoWithNotFoundException(
$controller :
RoleController
)
: mixed
Parameters
- $controller : RoleController
Tags
Return values
mixedtestGetInfo()
public
testGetInfo(
$controller :
RoleController
)
: mixed
Parameters
- $controller : RoleController
Tags
Return values
mixedtestGetList()
public
testGetList(
$controller :
RoleController
)
: mixed
Parameters
- $controller : RoleController
Tags
Return values
mixedtestGetModalConfirmDelete()
public
testGetModalConfirmDelete(
$controller :
RoleController
)
: mixed
Parameters
- $controller : RoleController
Tags
Return values
mixedtestGetModalConfirmDeleteWithNoGetData()
public
testGetModalConfirmDeleteWithNoGetData(
$controller :
RoleController
)
: mixed
Parameters
- $controller : RoleController
Tags
Return values
mixedtestGetModalConfirmDeleteWithNonExistingRole()
public
testGetModalConfirmDeleteWithNonExistingRole(
$controller :
RoleController
)
: mixed
Parameters
- $controller : RoleController
Tags
Return values
mixedtestGetModalConfirmDeleteWithUserInRole()
public
testGetModalConfirmDeleteWithUserInRole(
$controller :
RoleController
)
: mixed
Parameters
- $controller : RoleController
Tags
Return values
mixedtestGetModalConfirmDeleteWithDefaultRole()
public
testGetModalConfirmDeleteWithDefaultRole(
$controller :
RoleController
)
: mixed
Parameters
- $controller : RoleController
Tags
Return values
mixedtestGetModalCreate()
public
testGetModalCreate(
$controller :
RoleController
)
: mixed
Parameters
- $controller : RoleController
Tags
Return values
mixedtestGetModalEdit()
public
testGetModalEdit(
$controller :
RoleController
)
: mixed
Parameters
- $controller : RoleController
Tags
Return values
mixedtestGetModalEditWithNoGetData()
public
testGetModalEditWithNoGetData(
$controller :
RoleController
)
: mixed
Parameters
- $controller : RoleController
Tags
Return values
mixedtestGetModalEditWithNonExistingRole()
public
testGetModalEditWithNonExistingRole(
$controller :
RoleController
)
: mixed
Parameters
- $controller : RoleController
Tags
Return values
mixedtestGetUsersWithBadSlug()
public
testGetUsersWithBadSlug(
$controller :
RoleController
)
: mixed
Parameters
- $controller : RoleController
Tags
Return values
mixedtestGetUsersWithNoSlug()
public
testGetUsersWithNoSlug(
$controller :
RoleController
)
: mixed
Parameters
- $controller : RoleController
Tags
Return values
mixedtestGetUsers()
public
testGetUsers(
$controller :
RoleController
)
: mixed
Parameters
- $controller : RoleController
Tags
Return values
mixedtestpageInfo()
public
testpageInfo(
$controller :
RoleController
)
: mixed
Parameters
- $controller : RoleController
Tags
Return values
mixedtestpageInfoWithBadSlug()
public
testpageInfoWithBadSlug(
$controller :
RoleController
)
: mixed
Parameters
- $controller : RoleController
Tags
Return values
mixedtestpageList()
public
testpageList(
$controller :
RoleController
)
: mixed
Parameters
- $controller : RoleController
Tags
Return values
mixedtestUpdateInfo()
public
testUpdateInfo(
$controller :
RoleController
)
: mixed
Parameters
- $controller : RoleController
Tags
Return values
mixedtestUpdateInfoWithMissingName()
public
testUpdateInfoWithMissingName(
$controller :
RoleController
)
: mixed
Parameters
- $controller : RoleController
Tags
Return values
mixedtestUpdateInfoWithMissingSlug()
public
testUpdateInfoWithMissingSlug(
$controller :
RoleController
)
: mixed
Parameters
- $controller : RoleController
Tags
Return values
mixedtestUpdateInfoWithDuplicateSlug()
public
testUpdateInfoWithDuplicateSlug(
$controller :
RoleController
)
: mixed
Parameters
- $controller : RoleController
Tags
Return values
mixedtestUpdateInfoWithDuplicateName()
public
testUpdateInfoWithDuplicateName(
$controller :
RoleController
)
: mixed
Parameters
- $controller : RoleController
Tags
Return values
mixedtestGetModalEditPermissions()
public
testGetModalEditPermissions(
$controller :
RoleController
)
: mixed
Parameters
- $controller : RoleController
Tags
Return values
mixedtestGetModalEditPermissionsWithNoGetData()
public
testGetModalEditPermissionsWithNoGetData(
$controller :
RoleController
)
: mixed
Parameters
- $controller : RoleController
Tags
Return values
mixedtestGetModalEditPermissionsWithNonExistingRole()
public
testGetModalEditPermissionsWithNonExistingRole(
$controller :
RoleController
)
: mixed
Parameters
- $controller : RoleController
Tags
Return values
mixedtestGetPermissions()
public
testGetPermissions(
$controller :
RoleController
)
: mixed
Parameters
- $controller : RoleController
Tags
Return values
mixedtestGetPermissionsWithNoArgs()
public
testGetPermissionsWithNoArgs(
$controller :
RoleController
)
: mixed
Parameters
- $controller : RoleController
Tags
Return values
mixedtestGetPermissionsWithNonExistingRole()
public
testGetPermissionsWithNonExistingRole(
$controller :
RoleController
)
: mixed
Parameters
- $controller : RoleController
Tags
Return values
mixedtestupdateField()
public
testupdateField(
$controller :
RoleController
)
: mixed
Parameters
- $controller : RoleController
Tags
Return values
mixedtestupdateFieldWithNonExistingRole()
public
testupdateFieldWithNonExistingRole(
$controller :
RoleController
)
: mixed
Parameters
- $controller : RoleController
Tags
Return values
mixedtestupdateFieldNoValue()
public
testupdateFieldNoValue(
$controller :
RoleController
)
: mixed
Parameters
- $controller : RoleController
Tags
Return values
mixedtestupdateFieldWithFailedValidation()
public
testupdateFieldWithFailedValidation(
$controller :
RoleController
)
: mixed
Parameters
- $controller : RoleController
Tags
Return values
mixedtestupdateFieldWithPermissionField()
public
testupdateFieldWithPermissionField(
$controller :
RoleController
)
: mixed
Parameters
- $controller : RoleController
Tags
Return values
mixedgetController()
private
getController(
)
: RoleController
Return values
RoleControllersetupUser()
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