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
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
$MemberRoles
MemberRoles table
protected
MemberRolesTable
$MemberRoles
$Officers
Officers table
protected
OfficersTable
$Officers
$Offices
Offices table
protected
OfficesTable
$Offices
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
setUp()
setUp method
protected
setUp() : void
tearDown()
tearDown method
protected
tearDown() : void