KMP PHP API Reference

OfficesControllerTest extends HttpIntegrationTestCase
in package

Officers\Controller\OfficesController Test Case

Tests the OfficesController including the new transaction-wrapped officer recalculation functionality for office configuration changes.

Tags
uses
OfficesController

Table of Contents

Properties

$MemberRoles  : MemberRolesTable
MemberRoles table
$Officers  : OfficersTable
Officers table
$Offices  : OfficesTable
Offices table

Methods

testEditOfficeShowsCurrentAndUpcomingOfficerCounts()  : void
Test edit method shows current and upcoming officer counts
testEditOfficeTransactionRollbackOnRecalculationFailure()  : void
Test edit method transaction rollback on recalculation failure
testEditOfficeValidationErrorDoesNotStartTransaction()  : void
Test edit method with validation error doesn't start transaction
testEditOfficeWithDeputyToChangeRecalculatesOfficers()  : void
Test edit method with deputy_to_id change recalculates officers
testEditOfficeWithNoOfficerImpactingChangesDoesNotRecalculate()  : void
Test edit method with no officer-impacting changes doesn't recalculate
testEditOfficeWithReportsToChangeRecalculatesOfficers()  : void
Test edit method with reports_to_id change recalculates officers
testEditOfficeWithRoleAddedCreatesMemberRoles()  : void
Test edit method with grants_role_id added creates member roles
testEditOfficeWithRoleRemovedEndsMemberRoles()  : void
Test edit method with grants_role_id removed ends member roles
setUp()  : void
setUp method
tearDown()  : void
tearDown method

Properties

Methods

testEditOfficeShowsCurrentAndUpcomingOfficerCounts()

Test edit method shows current and upcoming officer counts

public testEditOfficeShowsCurrentAndUpcomingOfficerCounts() : void

Flash message should distinguish between current and upcoming officers updated.

testEditOfficeTransactionRollbackOnRecalculationFailure()

Test edit method transaction rollback on recalculation failure

public testEditOfficeTransactionRollbackOnRecalculationFailure() : void

When officer recalculation fails, the entire transaction including office save should be rolled back.

testEditOfficeValidationErrorDoesNotStartTransaction()

Test edit method with validation error doesn't start transaction

public testEditOfficeValidationErrorDoesNotStartTransaction() : void

When office validation fails (e.g., empty branch_types), no transaction should be started and no officers should be affected.

testEditOfficeWithDeputyToChangeRecalculatesOfficers()

Test edit method with deputy_to_id change recalculates officers

public testEditOfficeWithDeputyToChangeRecalculatesOfficers() : void

testEditOfficeWithNoOfficerImpactingChangesDoesNotRecalculate()

Test edit method with no officer-impacting changes doesn't recalculate

public testEditOfficeWithNoOfficerImpactingChangesDoesNotRecalculate() : void

When an office's name or other non-officer fields change, no recalculation should occur and the standard success message should display.

testEditOfficeWithReportsToChangeRecalculatesOfficers()

Test edit method with reports_to_id change recalculates officers

public testEditOfficeWithReportsToChangeRecalculatesOfficers() : void

When an office's reports_to_id changes, all current and upcoming officers should be recalculated in a single transaction.

testEditOfficeWithRoleAddedCreatesMemberRoles()

Test edit method with grants_role_id added creates member roles

public testEditOfficeWithRoleAddedCreatesMemberRoles() : void

testEditOfficeWithRoleRemovedEndsMemberRoles()

Test edit method with grants_role_id removed ends member roles

public testEditOfficeWithRoleRemovedEndsMemberRoles() : void

        
On this page

Search results