diff --git a/tests/Feature/Api/V1/AttendanceTracking/AttendanceTrackingControllerTest.php b/tests/Feature/Api/V1/AttendanceTracking/AttendanceTrackingControllerTest.php index 92969735..37e92e9b 100644 --- a/tests/Feature/Api/V1/AttendanceTracking/AttendanceTrackingControllerTest.php +++ b/tests/Feature/Api/V1/AttendanceTracking/AttendanceTrackingControllerTest.php @@ -2,6 +2,7 @@ namespace Tests\Feature\Api\V1\AttendanceTracking; +use App\Services\AttendanceTracking\AttendanceMailerService; use App\Services\AttendanceTracking\AttendanceTrackingService; use Mockery; use Mockery\MockInterface; @@ -15,6 +16,19 @@ class AttendanceTrackingControllerTest extends TestCase parent::tearDown(); } + protected function setUp(): void + { + parent::setUp(); + + // Bind the AttendanceMailerService interface to a mock so the + // controller can be instantiated during route middleware gathering + // even when the full service chain is not mocked. + $this->app->instance( + AttendanceMailerService::class, + Mockery::mock(AttendanceMailerService::class) + ); + } + protected function mockService(): MockInterface { $service = Mockery::mock(AttendanceTrackingService::class);