UserTest
extends TestCase
in package
PermissionProvider User Test Class
Tags
Table of Contents
- $testuser : string
- Current test user
- $userValueMap : array<string|int, mixed>
- User test data for testing.
- testBadConfig() : void
- Test an invalid configuration
- testGetPermissions() : void
- Test single option with matching string
- check() : void
- Convenience method for executing similar tests
- getMockAuthorizationService() : AuthorizationService
- Get a mock authorization service object
- getMockUser() : User
- Get a mock user object
Properties
$testuser
Current test user
protected
string
$testuser
= 'testuser1'
$userValueMap
User test data for testing.
protected
array<string|int, mixed>
$userValueMap
= ['testuser1' => [['username', 'mbeh'], ['email', 'markus.beh@ub.uni-freiburg.de'], ['college', 'Albert Ludwigs Universität Freiburg']], 'testuser2' => [['username', 'mbeh2'], ['email', 'markus.beh@ub.uni-freiburg.de'], ['college', 'Villanova University'], ['major', 'alumni']]]
Methods
testBadConfig()
Test an invalid configuration
public
testBadConfig() : void
Return values
void —testGetPermissions()
Test single option with matching string
public
testGetPermissions() : void
Return values
void —check()
Convenience method for executing similar tests
protected
check(string $testuser, array<string|int, mixed> $options, array<string|int, mixed> $roles) : void
Parameters
- $testuser : string
-
Name of testuser
- $options : array<string|int, mixed>
-
Options like settings in permissions.ini
- $roles : array<string|int, mixed>
-
Roles to return if match
Return values
void —getMockAuthorizationService()
Get a mock authorization service object
protected
getMockAuthorizationService() : AuthorizationService
Return values
AuthorizationService —getMockUser()
Get a mock user object
protected
getMockUser() : User