UserFrosting API

RoleControllerTest extends TestCase Uses TestDatabase, RefreshDatabase, withTestUser, withController

Tests RoleController

Table of Contents

$initialized bool
$migrated bool
setUp() Setup test database for controller tests void
testControllerConstructor() mixed
testControllerConstructorWithUser() RoleController
testCreate() mixed
testCreateWithMissingName() mixed
testCreateWithDuplicateSlug() mixed
testCreateWithDuplicateName() mixed
testDelete() mixed
testDeleteWithNotExistingRole() mixed
testDeleteWithDefaultRole() mixed
testDeleteWithUserInRole() mixed
testGetInfoWithNotFoundException() mixed
testGetInfo() mixed
testGetList() mixed
testGetModalConfirmDelete() mixed
testGetModalConfirmDeleteWithNoGetData() mixed
testGetModalConfirmDeleteWithNonExistingRole() mixed
testGetModalConfirmDeleteWithUserInRole() mixed
testGetModalConfirmDeleteWithDefaultRole() mixed
testGetModalCreate() mixed
testGetModalEdit() mixed
testGetModalEditWithNoGetData() mixed
testGetModalEditWithNonExistingRole() mixed
testGetUsersWithBadSlug() mixed
testGetUsersWithNoSlug() mixed
testGetUsers() mixed
testpageInfo() mixed
testpageInfoWithBadSlug() mixed
testpageList() mixed
testUpdateInfo() mixed
testUpdateInfoWithMissingName() mixed
testUpdateInfoWithMissingSlug() mixed
testUpdateInfoWithDuplicateSlug() mixed
testUpdateInfoWithDuplicateName() mixed
testGetModalEditPermissions() mixed
testGetModalEditPermissionsWithNoGetData() mixed
testGetModalEditPermissionsWithNonExistingRole() mixed
testGetPermissions() mixed
testGetPermissionsWithNoArgs() mixed
testGetPermissionsWithNonExistingRole() mixed
testupdateField() mixed
testupdateFieldWithNonExistingRole() mixed
testupdateFieldNoValue() mixed
testupdateFieldWithFailedValidation() mixed
testupdateFieldWithPermissionField() mixed
getController() RoleController
setupUser() mixed
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

testControllerConstructor()

public testControllerConstructor( ) : mixed
Return values
mixed

testDeleteWithNotExistingRole()

public testDeleteWithNotExistingRole( $controller : RoleController ) : mixed
Parameters
$controller : RoleController
Tags
depends

testControllerConstructorWithUser

depends

testDelete

Return values
mixed

testDeleteWithDefaultRole()

public testDeleteWithDefaultRole( $controller : RoleController ) : mixed
Parameters
$controller : RoleController
Tags
depends

testControllerConstructorWithUser

depends

testDelete

Return values
mixed

testDeleteWithUserInRole()

public testDeleteWithUserInRole( $controller : RoleController ) : mixed
Parameters
$controller : RoleController
Tags
depends

testControllerConstructorWithUser

depends

testDelete

Return values
mixed

testGetInfoWithNotFoundException()

public testGetInfoWithNotFoundException( $controller : RoleController ) : mixed
Parameters
$controller : RoleController
Tags
depends

testControllerConstructorWithUser

Return values
mixed

testGetModalConfirmDeleteWithNoGetData()

public testGetModalConfirmDeleteWithNoGetData( $controller : RoleController ) : mixed
Parameters
$controller : RoleController
Tags
depends

testControllerConstructorWithUser

depends

testGetModalConfirmDelete

Return values
mixed

testGetModalConfirmDeleteWithNonExistingRole()

public testGetModalConfirmDeleteWithNonExistingRole( $controller : RoleController ) : mixed
Parameters
$controller : RoleController
Tags
depends

testControllerConstructorWithUser

depends

testGetModalConfirmDelete

Return values
mixed

testGetModalConfirmDeleteWithUserInRole()

public testGetModalConfirmDeleteWithUserInRole( $controller : RoleController ) : mixed
Parameters
$controller : RoleController
Tags
depends

testControllerConstructorWithUser

depends

testGetModalConfirmDelete

Return values
mixed

testGetModalConfirmDeleteWithDefaultRole()

public testGetModalConfirmDeleteWithDefaultRole( $controller : RoleController ) : mixed
Parameters
$controller : RoleController
Tags
depends

testControllerConstructorWithUser

depends

testGetModalConfirmDelete

Return values
mixed

testGetModalEditWithNoGetData()

public testGetModalEditWithNoGetData( $controller : RoleController ) : mixed
Parameters
$controller : RoleController
Tags
depends

testControllerConstructorWithUser

depends

testGetModalEdit

Return values
mixed

testGetModalEditWithNonExistingRole()

public testGetModalEditWithNonExistingRole( $controller : RoleController ) : mixed
Parameters
$controller : RoleController
Tags
depends

testControllerConstructorWithUser

depends

testGetModalEdit

Return values
mixed

testUpdateInfoWithMissingName()

public testUpdateInfoWithMissingName( $controller : RoleController ) : mixed
Parameters
$controller : RoleController
Tags
depends

testControllerConstructorWithUser

depends

testUpdateInfo

Return values
mixed

testUpdateInfoWithMissingSlug()

public testUpdateInfoWithMissingSlug( $controller : RoleController ) : mixed
Parameters
$controller : RoleController
Tags
depends

testControllerConstructorWithUser

depends

testUpdateInfo

Return values
mixed

testUpdateInfoWithDuplicateSlug()

public testUpdateInfoWithDuplicateSlug( $controller : RoleController ) : mixed
Parameters
$controller : RoleController
Tags
depends

testControllerConstructorWithUser

depends

testUpdateInfo

Return values
mixed

testUpdateInfoWithDuplicateName()

public testUpdateInfoWithDuplicateName( $controller : RoleController ) : mixed
Parameters
$controller : RoleController
Tags
depends

testControllerConstructorWithUser

depends

testUpdateInfo

Return values
mixed

testGetModalEditPermissionsWithNoGetData()

public testGetModalEditPermissionsWithNoGetData( $controller : RoleController ) : mixed
Parameters
$controller : RoleController
Tags
depends

testControllerConstructorWithUser

depends

testGetModalEditPermissions

Return values
mixed

testGetModalEditPermissionsWithNonExistingRole()

public testGetModalEditPermissionsWithNonExistingRole( $controller : RoleController ) : mixed
Parameters
$controller : RoleController
Tags
depends

testControllerConstructorWithUser

depends

testGetModalEditPermissions

Return values
mixed

testGetPermissionsWithNoArgs()

public testGetPermissionsWithNoArgs( $controller : RoleController ) : mixed
Parameters
$controller : RoleController
Tags
depends

testControllerConstructorWithUser

depends

testGetPermissions

Return values
mixed

testGetPermissionsWithNonExistingRole()

public testGetPermissionsWithNonExistingRole( $controller : RoleController ) : mixed
Parameters
$controller : RoleController
Tags
depends

testControllerConstructorWithUser

depends

testGetPermissions

Return values
mixed

testupdateFieldWithNonExistingRole()

public testupdateFieldWithNonExistingRole( $controller : RoleController ) : mixed
Parameters
$controller : RoleController
Tags
depends

testControllerConstructorWithUser

Return values
mixed

testupdateFieldWithFailedValidation()

public testupdateFieldWithFailedValidation( $controller : RoleController ) : mixed
Parameters
$controller : RoleController
Tags
depends

testControllerConstructorWithUser

depends

testupdateField

Return values
mixed

testupdateFieldWithPermissionField()

public testupdateFieldWithPermissionField( $controller : RoleController ) : mixed
Parameters
$controller : RoleController
Tags
depends

testControllerConstructorWithUser

depends

testupdateField

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