PHP Class TinyAuth\Test\Auth\TinyAuthorizeTest

Inheritance: extends Cake\TestSuite\TestCase
Afficher le fichier Open project: dereuromark/cakephp-tinyauth

Méthodes publiques

Свойство Type Description
$collection Cake\Controller\ComponentRegistry
$fixtures array
$request Cake\Http\ServerRequest | Cake\Network\Request

Méthodes publiques

Méthode Description
setUp ( ) : void
testAdminMethodsAllowed ( ) : void Test with enabled configuration settings - access to all actions that are prefixed using the same role configuration setting.
testAvailableRoles ( ) : void Tests fetching available Roles from Configure and database
testAvailableRolesEmptyTableException ( ) : void Tests exception thrown when the roles database table exists but contains no roles/records.
testAvailableRolesMissingTableException ( ) : void Tests exception thrown when no roles are in Configure AND the roles database table does not exist.
testBasicUserMethodAllowed ( ) : void
testBasicUserMethodAllowedMultiRole ( ) : void Tests multi-role authorization.
testBasicUserMethodAllowedWildcard ( ) : void Tests access to a controller that uses the * wildcard for both the action and the allowed groups (* = *).
testBasicUserMethodAllowedWildcardSpecificGroup ( ) : void Tests access to a controller that uses the * wildcard for the action but combines it with a specific group (here: * = moderators).
testBasicUserMethodAllowedWithLongActionNames ( ) : void
testBasicUserMethodAllowedWithLongActionNamesUnderscored ( ) : void
testBasicUserMethodDisallowed ( ) : void
testBasicUserMethodInexistentRole ( ) : void
testCaseSensitivity ( ) : void Tests using incorrect casing, enforces strict acl.ini definitions.
testConstructor ( ) : void Test applying config in the constructor
testConstructorWithoutValidCache ( ) : void Tests exception thrown when Cache is unavailable.
testGetAcl ( ) : void
testIdColumnPivotTable ( ) : void Tests idColumn
testIniConstruct ( ) : void Tests constructing an ACL ini section key using CakeRequest parameters
testIniDeconstruct ( ) : void Tests deconstructing an ACL ini section key
testIniParsing ( ) : void Tests acl.ini parsing method.
testIniParsingMissingFileException ( ) : void Tests exception thrown when no acl.ini exists.
testSuperAdmin ( ) : void Tests super admin
testSuperAdminRole ( ) : void Tests superAdmin role, allowed to all actions
testUserMethodsAllowed ( ) : void Tests with configuration setting 'allowUser' set to true, giving user access to all controller/actions except when prefixed with /admin
testUserRoles ( ) : void Tests fetching user roles
testUserRolesCustomPivotTable ( ) : void Tests fetching user roles
testUserRolesMissingRoleColumn ( ) : void Tests single-role exception thrown when the roleColumn field is missing from the user table.
testUserRolesUserWithoutPivotRoles ( ) : void Tests multi-role when user has no roles in the pivot table.

Method Details

setUp() public méthode

public setUp ( ) : void
Résultat void

testAdminMethodsAllowed() public méthode

TODO: also allow mapping of "prefix" => "role" for more flexibility
public testAdminMethodsAllowed ( ) : void
Résultat void

testAvailableRoles() public méthode

Tests fetching available Roles from Configure and database
public testAvailableRoles ( ) : void
Résultat void

testAvailableRolesEmptyTableException() public méthode

Tests exception thrown when the roles database table exists but contains no roles/records.

testAvailableRolesMissingTableException() public méthode

Tests exception thrown when no roles are in Configure AND the roles database table does not exist.

testBasicUserMethodAllowed() public méthode

public testBasicUserMethodAllowed ( ) : void
Résultat void

testBasicUserMethodAllowedMultiRole() public méthode

Tests multi-role authorization.

testBasicUserMethodAllowedWildcard() public méthode

Note: users without a valid/defined role will not be granted access.

testBasicUserMethodAllowedWildcardSpecificGroup() public méthode

Tests access to a controller that uses the * wildcard for the action but combines it with a specific group (here: * = moderators).

testBasicUserMethodAllowedWithLongActionNames() public méthode

testBasicUserMethodAllowedWithLongActionNamesUnderscored() public méthode

testBasicUserMethodDisallowed() public méthode

public testBasicUserMethodDisallowed ( ) : void
Résultat void

testBasicUserMethodInexistentRole() public méthode

testCaseSensitivity() public méthode

Tests using incorrect casing, enforces strict acl.ini definitions.
public testCaseSensitivity ( ) : void
Résultat void

testConstructor() public méthode

Test applying config in the constructor
public testConstructor ( ) : void
Résultat void

testConstructorWithoutValidCache() public méthode

Tests exception thrown when Cache is unavailable.
public testConstructorWithoutValidCache ( ) : void
Résultat void

testGetAcl() public méthode

public testGetAcl ( ) : void
Résultat void

testIdColumnPivotTable() public méthode

Tests idColumn
public testIdColumnPivotTable ( ) : void
Résultat void

testIniConstruct() public méthode

Tests constructing an ACL ini section key using CakeRequest parameters
public testIniConstruct ( ) : void
Résultat void

testIniDeconstruct() public méthode

Tests deconstructing an ACL ini section key
public testIniDeconstruct ( ) : void
Résultat void

testIniParsing() public méthode

Tests acl.ini parsing method.
public testIniParsing ( ) : void
Résultat void

testIniParsingMissingFileException() public méthode

Tests exception thrown when no acl.ini exists.

testSuperAdmin() public méthode

Tests super admin
public testSuperAdmin ( ) : void
Résultat void

testSuperAdminRole() public méthode

Tests superAdmin role, allowed to all actions
public testSuperAdminRole ( ) : void
Résultat void

testUserMethodsAllowed() public méthode

Tests with configuration setting 'allowUser' set to true, giving user access to all controller/actions except when prefixed with /admin
public testUserMethodsAllowed ( ) : void
Résultat void

testUserRoles() public méthode

Tests fetching user roles
public testUserRoles ( ) : void
Résultat void

testUserRolesCustomPivotTable() public méthode

Tests fetching user roles
public testUserRolesCustomPivotTable ( ) : void
Résultat void

testUserRolesMissingRoleColumn() public méthode

Tests single-role exception thrown when the roleColumn field is missing from the user table.
public testUserRolesMissingRoleColumn ( ) : void
Résultat void

testUserRolesUserWithoutPivotRoles() public méthode

Tests multi-role when user has no roles in the pivot table.

Property Details

$collection public_oe property

public ComponentRegistry,Cake\Controller $collection
Résultat Cake\Controller\ComponentRegistry

$fixtures public_oe property

public array $fixtures
Résultat array

$request public_oe property

public ServerRequest,Cake\Http|Request,Cake\Network $request
Résultat Cake\Http\ServerRequest | Cake\Network\Request