Open Journal Systems  2.4.3
 All Classes Namespaces Functions Variables Groups Pages
PolicyTestCase Class Reference
Inheritance diagram for PolicyTestCase:
PKPTestCase AuthorizationDecisionManagerTest PKPProcessAccessPolicyTest PKPPublicAccessPolicyTest RoleBasedHandlerOperationPolicyTest

Public Member Functions

 mockEffect ()
 
 mockGetContext ()
 
- Public Member Functions inherited from PKPTestCase
 getActualOutput ()
 

Protected Member Functions

 getAuthorizationContextManipulationPolicy ()
 
 getMockedRegistryKeys ()
 
 getMockRequest ($requestedOp, $context=null, $user=null)
 
- Protected Member Functions inherited from PKPTestCase
 getMockedDAOs ()
 
 getMockedRegistryKeys ()
 
 setTestConfiguration ($config, $configPath= 'config')
 
 setUp ()
 
 tearDown ()
 

Detailed Description

Abstract base test class that provides infrastructure for several types of policy tests.

See Also
RoleBasedHandlerOperation

Definition at line 24 of file PolicyTestCase.inc.php.

Member Function Documentation

PolicyTestCase::getAuthorizationContextManipulationPolicy ( )
protected

Create an authorization context manipulation policy.

Returns
$testPolicy AuthorizationPolicy the policy that will be used by the decision manager to call this mock method.

Definition at line 68 of file PolicyTestCase.inc.php.

Referenced by mockEffect(), AuthorizationDecisionManagerTest\testAuthorizationContext(), and RoleBasedHandlerOperationPolicyTest\testRoleAuthorization().

PolicyTestCase::getMockedRegistryKeys ( )
protected
See Also
PKPTestCase::getMockedRegistryKeys()

Definition at line 41 of file PolicyTestCase.inc.php.

PolicyTestCase::getMockRequest (   $requestedOp,
  $context = null,
  $user = null 
)
protected

Instantiate a mock request to the given operation.

Parameters
$requestedOpstring the requested operation
$contextarray request context object(s) to be returned by the router.
$userUser a user to be put into the registry.
Returns
PKPRequest

Definition at line 108 of file PolicyTestCase.inc.php.

References Registry\set().

Referenced by PKPProcessAccessPolicyTest\testPKPProcessAccessPolicy(), PKPPublicAccessPolicyTest\testPKPPublicAccessPolicy(), and RoleBasedHandlerOperationPolicyTest\testRoleAuthorization().

PolicyTestCase::mockEffect ( )

Callback method that will be called in place of the effect() method of a mock policy.

Returns
integer AUTHORIZATION_PERMIT

Definition at line 86 of file PolicyTestCase.inc.php.

References getAuthorizationContextManipulationPolicy().

PolicyTestCase::mockGetContext ( )

Callback used by PKPRouter created in getMockRequest().

See Also
PKPRouter::getContext()
Returns
mixed Context object or null

Definition at line 143 of file PolicyTestCase.inc.php.


The documentation for this class was generated from the following file: