PHP 클래스 TinyAuth\Test\Auth\TinyAuthorizeTest

상속: extends Cake\TestSuite\TestCase
파일 보기 프로젝트 열기: dereuromark/cakephp-tinyauth

공개 프로퍼티들

프로퍼티 타입 설명
$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.

testAvailableRolesMissingTableException() 공개 메소드

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

testBasicUserMethodAllowed() 공개 메소드

public testBasicUserMethodAllowed ( ) : void
리턴 void

testBasicUserMethodAllowedMultiRole() 공개 메소드

Tests multi-role authorization.

testBasicUserMethodAllowedWildcard() 공개 메소드

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

testBasicUserMethodAllowedWildcardSpecificGroup() 공개 메소드

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

testBasicUserMethodAllowedWithLongActionNames() 공개 메소드

testBasicUserMethodAllowedWithLongActionNamesUnderscored() 공개 메소드

testBasicUserMethodDisallowed() 공개 메소드

testBasicUserMethodInexistentRole() 공개 메소드

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.

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.

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

testUserRolesMissingRoleColumn() 공개 메소드

Tests single-role exception thrown when the roleColumn field is missing from the user table.

testUserRolesUserWithoutPivotRoles() 공개 메소드

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

프로퍼티 상세

$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