insert([ 'id' => 1, 'school_id' => 'S1', 'firstname' => 'Student', 'lastname' => 'One', 'age' => 8, 'gender' => 'Male', 'photo_consent' => 1, 'parent_id' => 1, 'year_of_registration' => '2025', 'school_year' => '2025-2026', ]); $parentLookup = Mockery::mock(AttendanceParentLookupService::class); $parentLookup->shouldReceive('getPrimaryParentForStudent')->once()->andReturn([]); $service = new AttendanceNotificationWorkflowService( new Student, new StudentClass, new AttendanceData, new AttendanceTracking, new Configuration, Mockery::mock(AttendanceMailerService::class), Mockery::mock(ViolationRuleEngineService::class), $parentLookup, Mockery::mock(AttendanceEmailComposerService::class), Mockery::mock(AttendanceNotificationLogService::class) ); $result = $service->record([ 'student_id' => 1, 'date' => '2025-01-01', ]); $this->assertFalse($result['success']); $this->assertSame(422, $result['status']); } }