PHP Класс TinyAuth\Test\Auth\TinyAuthorizeTest

Наследование: extends Cake\TestSuite\TestCase
Показать файл Открыть проект

Открытые свойства

Свойство Тип Описание
$collection Cake\Controller\ComponentRegistry
$fixtures array
$request Cake\Http\ServerRequest | Cake\Network\Request

Открытые методы

Метод Описание
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.

Описание методов

setUp() публичный Метод

public setUp ( ) : void
Результат void

testAdminMethodsAllowed() публичный Метод

TODO: also allow mapping of "prefix" => "role" for more flexibility
public testAdminMethodsAllowed ( ) : void
Результат void

testAvailableRoles() публичный Метод

Tests fetching available Roles from Configure and database
public testAvailableRoles ( ) : void
Результат void

testAvailableRolesEmptyTableException() публичный Метод

Tests exception thrown when the roles database table exists but contains no roles/records.
public testAvailableRolesEmptyTableException ( ) : void
Результат void

testAvailableRolesMissingTableException() публичный Метод

Tests exception thrown when no roles are in Configure AND the roles database table does not exist.
public testAvailableRolesMissingTableException ( ) : void
Результат void

testBasicUserMethodAllowed() публичный Метод

public testBasicUserMethodAllowed ( ) : void
Результат void

testBasicUserMethodAllowedMultiRole() публичный Метод

Tests multi-role authorization.
public testBasicUserMethodAllowedMultiRole ( ) : void
Результат void

testBasicUserMethodAllowedWildcard() публичный Метод

Note: users without a valid/defined role will not be granted access.
public testBasicUserMethodAllowedWildcard ( ) : void
Результат void

testBasicUserMethodAllowedWildcardSpecificGroup() публичный Метод

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

testBasicUserMethodAllowedWithLongActionNames() публичный Метод

public testBasicUserMethodAllowedWithLongActionNames ( ) : void
Результат void

testBasicUserMethodAllowedWithLongActionNamesUnderscored() публичный Метод

testBasicUserMethodDisallowed() публичный Метод

public testBasicUserMethodDisallowed ( ) : void
Результат void

testBasicUserMethodInexistentRole() публичный Метод

public testBasicUserMethodInexistentRole ( ) : void
Результат void

testCaseSensitivity() публичный Метод

Tests using incorrect casing, enforces strict acl.ini definitions.
public testCaseSensitivity ( ) : void
Результат void

testConstructor() публичный Метод

Test applying config in the constructor
public testConstructor ( ) : void
Результат void

testConstructorWithoutValidCache() публичный Метод

Tests exception thrown when Cache is unavailable.
public testConstructorWithoutValidCache ( ) : void
Результат void

testGetAcl() публичный Метод

public testGetAcl ( ) : void
Результат void

testIdColumnPivotTable() публичный Метод

Tests idColumn
public testIdColumnPivotTable ( ) : void
Результат void

testIniConstruct() публичный Метод

Tests constructing an ACL ini section key using CakeRequest parameters
public testIniConstruct ( ) : void
Результат void

testIniDeconstruct() публичный Метод

Tests deconstructing an ACL ini section key
public testIniDeconstruct ( ) : void
Результат void

testIniParsing() публичный Метод

Tests acl.ini parsing method.
public testIniParsing ( ) : void
Результат void

testIniParsingMissingFileException() публичный Метод

Tests exception thrown when no acl.ini exists.
public testIniParsingMissingFileException ( ) : void
Результат void

testSuperAdmin() публичный Метод

Tests super admin
public testSuperAdmin ( ) : void
Результат void

testSuperAdminRole() публичный Метод

Tests superAdmin role, allowed to all actions
public testSuperAdminRole ( ) : void
Результат void

testUserMethodsAllowed() публичный Метод

Tests with configuration setting 'allowUser' set to true, giving user access to all controller/actions except when prefixed with /admin
public testUserMethodsAllowed ( ) : void
Результат void

testUserRoles() публичный Метод

Tests fetching user roles
public testUserRoles ( ) : void
Результат void

testUserRolesCustomPivotTable() публичный Метод

Tests fetching user roles
public testUserRolesCustomPivotTable ( ) : void
Результат void

testUserRolesMissingRoleColumn() публичный Метод

Tests single-role exception thrown when the roleColumn field is missing from the user table.
public testUserRolesMissingRoleColumn ( ) : void
Результат void

testUserRolesUserWithoutPivotRoles() публичный Метод

Tests multi-role when user has no roles in the pivot table.
public testUserRolesUserWithoutPivotRoles ( ) : void
Результат void

Описание свойств

$collection публичное свойство

public ComponentRegistry,Cake\Controller $collection
Результат Cake\Controller\ComponentRegistry

$fixtures публичное свойство

public array $fixtures
Результат array

$request публичное свойство

public ServerRequest,Cake\Http|Request,Cake\Network $request
Результат Cake\Http\ServerRequest | Cake\Network\Request