Mockery's lifecycle (created in setUp, closed in tearDown) may
interfere with the container binding across tests. Using a plain
anonymous class avoids this issue entirely.
The previous approach of only mocking AttendanceTrackingService in
individual tests was not sufficient. The controller is resolved during
route middleware gathering (controllerMiddleware), which happens before
the test method body executes. By binding the AttendanceMailerService
interface to a mock in setUp, the full dependency chain is satisfied
regardless of whether the service-level mock is used.
- Add SanctumServiceProvider explicitly to bootstrap/providers.php
to ensure sanctum auth driver is registered in CI environments
- Add mockService() to 3 validation tests that were missing it
(test_record_returns_validation_errors_for_bad_payload,
test_send_manual_email_validates_payload,
test_save_notification_note_validates_payload)
to prevent container resolution failure during middleware gathering
- Update test URLs from /api/attendance-tracking/ to /api/v1/attendance-tracking/
to match current route structure