PrimoPermissionHandlerTest
extends TestCase
in package
Unit tests for Primo Permission Handler.
Tags
Table of Contents
- $backend : BackendInterface
- Backend.
- $primoConfig : array<string|int, mixed>
- Sample configuration.
- $primoConfigDefaultOnly : array<string|int, mixed>
- Sample configuration with default with onCampusRule.
- $primoConfigDefaultOnlyNoOnCampusRule : array<string|int, mixed>
- Sample configuration with default only.
- $primoConfigInstitutionCode : array<string|int, mixed>
- Sample configuration with institution code.
- $primoConfigWithoutDefault : array<string|int, mixed>
- Sample configuration without default.
- $primoConfigWithoutDefaultWithInstCode : array<string|int, mixed>
- Sample configuration without default, but with institutionCode setting.
- handlerDefaultAuthNotSuccessfullCallback() : bool
- Helper function (Callback) to inject different return values for the mock object with different parameters
- handlerDefaultAuthSuccessfullCallback() : bool
- Helper function (Callback) to inject different return values for the mock object with different parameters
- handlerIsNotAMemberCallback() : bool
- Helper function (Callback) to inject different return values for the mock object with different parameters
- handlerIsOnDefaultCampusCallback() : bool
- Helper function (Callback) to inject different return values for the mock object with different parameters
- handlerMemberAuthNotSuccessfullCallback() : bool
- Helper function (Callback) to inject different return values for the mock object with different parameters
- handlerMemberAuthSuccessfullCallback() : bool
- Helper function (Callback) to inject different return values for the mock object with different parameters
- handlerMemberIsNotOnCampusCallback() : bool
- Helper function (Callback) to inject different return values for the mock object with different parameters
- handlerMemberIsOnCampusCallback() : bool
- Helper function (Callback) to inject different return values for the mock object with different parameters
- testAuthNotExisting() : void
- Test the handler if permission does not exist
- testHandlerCodeSuccessfull() : void
- Test the handler code if permission matches This should return the actual institution code (depending on config)
- testHandlerDefaultAuthNotSuccessfull() : void
- Test the handler if permission does not match
- testHandlerDefaultAuthSuccessfull() : void
- Test the handler if permission does not match
- testHandlerDefaultCode() : void
- Test the handler if permission does not match This should return the default institution code (if this is configured, for this test it is configured)
- testHandlerDefaultOnlyAuthNotSuccessfull() : void
- Test the handler if permission (member and default) does not match
- testHandlerDefaultOnlyCodeAuthNotSuccessfull() : void
- Test the handler if permission does not match This should return the default PrimoInstance code (if this is configured, for this test it is configured)
- testHandlerDefaultOnlyCodeNoOncampus() : void
- Test the handler if permission does not match This should return the default PrimoInstance code (if this is configured, for this test it is configured)
- testHandlerDefaultOnlyDefaultAuthNotSuccessfull() : void
- Test the handler if permission does not match
- testHandlerDefaultOnlyDefaultAuthSuccessfull() : void
- Test the handler if permission does not match
- testHandlerDefaultOnlyNoOncampus() : void
- Permission cannot be granted without an onCampusRule
- testHandlerIsNotAMember() : void
- Test the handler if permission does not match
- testHandlerIsNotAMemberAndNotDefaultOnCampus() : void
- Test the handler if permission does not match
- testHandlerIsNotAMemberButOnDefaultCampus() : void
- Test the handler if permission does not exist
- testHandlerMemberAuthNotSuccessfull() : void
- Test the handler if permission (member and default) does not match
- testHandlerMemberAuthSuccessfull() : void
- Test the handler if permission via member code matches
- testHandlerMemberIsNotOnCampus() : void
- Test the handler if permission does not match This should return the default PrimoInstance code (if this is configured, for this test it is configured)
- testHandlerMemberIsNotOnCampusWithDefault() : void
- Test the handler if permission does not match This should return the default PrimoInstance code (if this is configured, for this test it is configured)
- testHandlerMemberIsOnCampus() : void
- Test the handler if permission (member and default) does not match
- testHandlerMemberIsOnCampusWithDefault() : void
- Test the handler if permission (member and default) does not match
- testHandlerWithoutDefaultAuthNotSuccessfull() : void
- Test the handler if permission (member and default) does not match
- testHandlerWithoutDefaultAuthSuccessfull() : void
- Test the handler if permission matches
- testHandlerWithoutDefaultCodeAuthNotSuccessfull() : void
- Test the handler if permission does not match This should return the default PrimoInstance code (if this is configured, for this test it is configured)
- testHandlerWithoutDefaultCodeSuccessfull() : void
- Test the handler code if permission matches
- testHandlerWithoutDefaultDefaultAuthNotSuccessfull() : void
- Test the handler if permission does not match
- testHandlerWithoutDefaultDefaultAuthSuccessfull() : void
- Test the handler if permission does not match
- testSetInstCode() : void
- Test the institution code setter
- testWithoutAuthorizationService() : void
- Test the handler without setting an authorization service.
- testWithoutAuthorizationServiceWithLaminasConfigObject() : void
- Test the handler without setting an authorization service.
- testWithoutConfig() : void
- Test the handler without configuration.
- setUp() : void
- Setup.
Properties
$backend
Backend.
protected
BackendInterface
$backend
$primoConfig
Sample configuration.
protected
array<string|int, mixed>
$primoConfig
= ['onCampusRule' => ['MEMBER' => 'primo.MEMBER', 'DEFAULT' => 'primo.defaultRule'], 'defaultCode' => 'DEFAULT']
$primoConfigDefaultOnly
Sample configuration with default with onCampusRule.
protected
array<string|int, mixed>
$primoConfigDefaultOnly
= ['defaultCode' => 'DEFAULT', 'onCampusRule' => ['DEFAULT' => 'primo.defaultRule']]
$primoConfigDefaultOnlyNoOnCampusRule
Sample configuration with default only.
protected
array<string|int, mixed>
$primoConfigDefaultOnlyNoOnCampusRule
= ['defaultCode' => 'DEFAULT']
$primoConfigInstitutionCode
Sample configuration with institution code.
protected
array<string|int, mixed>
$primoConfigInstitutionCode
= ['defaultCode' => 'DEFAULT', 'onCampusRule' => ['DEFAULT' => 'primo.defaultRule', 'MEMBER' => 'primo.isOnCampusAtMEMBER'], 'institutionCode' => ['MEMBER' => 'primo.isAtMEMBER']]
$primoConfigWithoutDefault
Sample configuration without default.
protected
array<string|int, mixed>
$primoConfigWithoutDefault
= ['onCampusRule' => ['MEMBER' => 'primo.MEMBER']]
$primoConfigWithoutDefaultWithInstCode
Sample configuration without default, but with institutionCode setting.
protected
array<string|int, mixed>
$primoConfigWithoutDefaultWithInstCode
= ['onCampusRule' => ['MEMBER' => 'primo.isOnCampusAtMEMBER'], 'institutionCode' => ['MEMBER' => 'primo.isAtMEMBER']]
Methods
handlerDefaultAuthNotSuccessfullCallback()
Helper function (Callback) to inject different return values for the mock object with different parameters
public
handlerDefaultAuthNotSuccessfullCallback(string $param) : bool
Parameters
- $param : string
-
Parameter name
Return values
bool —handlerDefaultAuthSuccessfullCallback()
Helper function (Callback) to inject different return values for the mock object with different parameters
public
handlerDefaultAuthSuccessfullCallback(string $param) : bool
Parameters
- $param : string
-
Parameter name
Return values
bool —handlerIsNotAMemberCallback()
Helper function (Callback) to inject different return values for the mock object with different parameters
public
handlerIsNotAMemberCallback(string $param) : bool
Parameters
- $param : string
-
Parameter name
Return values
bool —handlerIsOnDefaultCampusCallback()
Helper function (Callback) to inject different return values for the mock object with different parameters
public
handlerIsOnDefaultCampusCallback(string $param) : bool
Parameters
- $param : string
-
Parameter name
Return values
bool —handlerMemberAuthNotSuccessfullCallback()
Helper function (Callback) to inject different return values for the mock object with different parameters
public
handlerMemberAuthNotSuccessfullCallback(string $param) : bool
Parameters
- $param : string
-
Parameter name
Return values
bool —handlerMemberAuthSuccessfullCallback()
Helper function (Callback) to inject different return values for the mock object with different parameters
public
handlerMemberAuthSuccessfullCallback(string $param) : bool
Parameters
- $param : string
-
Parameter name
Return values
bool —handlerMemberIsNotOnCampusCallback()
Helper function (Callback) to inject different return values for the mock object with different parameters
public
handlerMemberIsNotOnCampusCallback(string $param) : bool
Parameters
- $param : string
-
Parameter name
Return values
bool —handlerMemberIsOnCampusCallback()
Helper function (Callback) to inject different return values for the mock object with different parameters
public
handlerMemberIsOnCampusCallback(string $param) : bool
Parameters
- $param : string
-
Parameter name
Return values
bool —testAuthNotExisting()
Test the handler if permission does not exist
public
testAuthNotExisting() : void
Return values
void —testHandlerCodeSuccessfull()
Test the handler code if permission matches This should return the actual institution code (depending on config)
public
testHandlerCodeSuccessfull() : void
Return values
void —testHandlerDefaultAuthNotSuccessfull()
Test the handler if permission does not match
public
testHandlerDefaultAuthNotSuccessfull() : void
Return values
void —testHandlerDefaultAuthSuccessfull()
Test the handler if permission does not match
public
testHandlerDefaultAuthSuccessfull() : void
Return values
void —testHandlerDefaultCode()
Test the handler if permission does not match This should return the default institution code (if this is configured, for this test it is configured)
public
testHandlerDefaultCode() : void
Return values
void —testHandlerDefaultOnlyAuthNotSuccessfull()
Test the handler if permission (member and default) does not match
public
testHandlerDefaultOnlyAuthNotSuccessfull() : void
Return values
void —testHandlerDefaultOnlyCodeAuthNotSuccessfull()
Test the handler if permission does not match This should return the default PrimoInstance code (if this is configured, for this test it is configured)
public
testHandlerDefaultOnlyCodeAuthNotSuccessfull() : void
Return values
void —testHandlerDefaultOnlyCodeNoOncampus()
Test the handler if permission does not match This should return the default PrimoInstance code (if this is configured, for this test it is configured)
public
testHandlerDefaultOnlyCodeNoOncampus() : void
Return values
void —testHandlerDefaultOnlyDefaultAuthNotSuccessfull()
Test the handler if permission does not match
public
testHandlerDefaultOnlyDefaultAuthNotSuccessfull() : void
Return values
void —testHandlerDefaultOnlyDefaultAuthSuccessfull()
Test the handler if permission does not match
public
testHandlerDefaultOnlyDefaultAuthSuccessfull() : void
Return values
void —testHandlerDefaultOnlyNoOncampus()
Permission cannot be granted without an onCampusRule
public
testHandlerDefaultOnlyNoOncampus() : void
Return values
void —testHandlerIsNotAMember()
Test the handler if permission does not match
public
testHandlerIsNotAMember() : void
Return values
void —testHandlerIsNotAMemberAndNotDefaultOnCampus()
Test the handler if permission does not match
public
testHandlerIsNotAMemberAndNotDefaultOnCampus() : void
Return values
void —testHandlerIsNotAMemberButOnDefaultCampus()
Test the handler if permission does not exist
public
testHandlerIsNotAMemberButOnDefaultCampus() : void
Return values
void —testHandlerMemberAuthNotSuccessfull()
Test the handler if permission (member and default) does not match
public
testHandlerMemberAuthNotSuccessfull() : void
Return values
void —testHandlerMemberAuthSuccessfull()
Test the handler if permission via member code matches
public
testHandlerMemberAuthSuccessfull() : void
Return values
void —testHandlerMemberIsNotOnCampus()
Test the handler if permission does not match This should return the default PrimoInstance code (if this is configured, for this test it is configured)
public
testHandlerMemberIsNotOnCampus() : void
Return values
void —testHandlerMemberIsNotOnCampusWithDefault()
Test the handler if permission does not match This should return the default PrimoInstance code (if this is configured, for this test it is configured)
public
testHandlerMemberIsNotOnCampusWithDefault() : void
Return values
void —testHandlerMemberIsOnCampus()
Test the handler if permission (member and default) does not match
public
testHandlerMemberIsOnCampus() : void
Return values
void —testHandlerMemberIsOnCampusWithDefault()
Test the handler if permission (member and default) does not match
public
testHandlerMemberIsOnCampusWithDefault() : void
Return values
void —testHandlerWithoutDefaultAuthNotSuccessfull()
Test the handler if permission (member and default) does not match
public
testHandlerWithoutDefaultAuthNotSuccessfull() : void
Return values
void —testHandlerWithoutDefaultAuthSuccessfull()
Test the handler if permission matches
public
testHandlerWithoutDefaultAuthSuccessfull() : void
Return values
void —testHandlerWithoutDefaultCodeAuthNotSuccessfull()
Test the handler if permission does not match This should return the default PrimoInstance code (if this is configured, for this test it is configured)
public
testHandlerWithoutDefaultCodeAuthNotSuccessfull() : void
Return values
void —testHandlerWithoutDefaultCodeSuccessfull()
Test the handler code if permission matches
public
testHandlerWithoutDefaultCodeSuccessfull() : void
Return values
void —testHandlerWithoutDefaultDefaultAuthNotSuccessfull()
Test the handler if permission does not match
public
testHandlerWithoutDefaultDefaultAuthNotSuccessfull() : void
Return values
void —testHandlerWithoutDefaultDefaultAuthSuccessfull()
Test the handler if permission does not match
public
testHandlerWithoutDefaultDefaultAuthSuccessfull() : void
Return values
void —testSetInstCode()
Test the institution code setter
public
testSetInstCode() : void
Return values
void —testWithoutAuthorizationService()
Test the handler without setting an authorization service.
public
testWithoutAuthorizationService() : void
This should always return false.
Return values
void —testWithoutAuthorizationServiceWithLaminasConfigObject()
Test the handler without setting an authorization service.
public
testWithoutAuthorizationServiceWithLaminasConfigObject() : void
This should always return false.
Return values
void —testWithoutConfig()
Test the handler without configuration.
public
testWithoutConfig() : void
This should throw an Exception.
Return values
void —setUp()
Setup.
protected
setUp() : void