KMP PHP API Reference

DefaultAuthorizationManagerTest extends BaseTestCase
in package

Activities\Services\DefaultAuthorizationManager Test Case

Tests the DefaultAuthorizationManager service including request, approve, deny, revoke, and retract workflows for activity authorizations.

Tags
uses
DefaultAuthorizationManager

Table of Contents

Constants

TEST_ACTIVITY_ID  = 1
Test activity ID from seed data (Armored, id=1)
TEST_SINGLE_APPROVAL_ACTIVITY_ID  = 1
Test activity that requires 1 approver

Properties

$Activities  : ActivitiesTable
Activities table
$authManager  : DefaultAuthorizationManager|MockObject
Service under test (mock with mailer stubbed)
$AuthorizationApprovals  : AuthorizationApprovalsTable
AuthorizationApprovals table
$Authorizations  : AuthorizationsTable
Authorizations table
$Members  : MembersTable
Members table

Methods

testApproveSingleApproverSuccess()  : void
Test approving a single-approver authorization completes the workflow
testDenyAuthorizationSuccess()  : void
Test denying an authorization request
testFullRequestApproveWorkflow()  : void
Test complete workflow: request → approve for single-approver activity
testFullRequestDenyWorkflow()  : void
Test complete workflow: request → deny
testRequestDuplicatePendingFails()  : void
Test duplicate pending request is rejected
testRequestNewAuthorizationSuccess()  : void
Test creating a new authorization request succeeds
testRequestRenewalWithoutExistingApprovedFails()  : void
Test renewal request without existing approved authorization fails
testRetractByDifferentMemberFails()  : void
Test retracting by a different member fails
testRetractNonExistentFails()  : void
Test retracting a non-existent authorization fails
testRetractNonPendingFails()  : void
Test retracting a non-pending authorization fails
testRetractPendingAuthorizationSuccess()  : void
Test retracting a pending authorization by the requester
testRevokeApprovedAuthorizationSuccess()  : void
Test revoking an approved authorization
setUp()  : void
setUp method
tearDown()  : void
tearDown method
createTestAuthorization()  : Authorization, approval: mixed}
Create a fresh authorization request for testing
findMemberWithoutPending()  : int
Find a member ID that has no pending authorization for the given activity

Constants

Properties

Methods

testApproveSingleApproverSuccess()

Test approving a single-approver authorization completes the workflow

public testApproveSingleApproverSuccess() : void

testFullRequestApproveWorkflow()

Test complete workflow: request → approve for single-approver activity

public testFullRequestApproveWorkflow() : void

testRequestNewAuthorizationSuccess()

Test creating a new authorization request succeeds

public testRequestNewAuthorizationSuccess() : void

testRequestRenewalWithoutExistingApprovedFails()

Test renewal request without existing approved authorization fails

public testRequestRenewalWithoutExistingApprovedFails() : void

testRetractPendingAuthorizationSuccess()

Test retracting a pending authorization by the requester

public testRetractPendingAuthorizationSuccess() : void

testRevokeApprovedAuthorizationSuccess()

Test revoking an approved authorization

public testRevokeApprovedAuthorizationSuccess() : void

createTestAuthorization()

Create a fresh authorization request for testing

private createTestAuthorization(int $requesterId, int $activityId, int $approverId) : Authorization, approval: mixed}
Parameters
$requesterId : int
$activityId : int
$approverId : int
Return values
Authorization, approval: mixed}

findMemberWithoutPending()

Find a member ID that has no pending authorization for the given activity

private findMemberWithoutPending(int $activityId) : int
Parameters
$activityId : int
Return values
int

        
On this page

Search results