insert([ 'id' => 5, 'firstname' => 'Parent', 'lastname' => 'One', 'email' => 'parent@example.com', 'status' => 'Active', ]); DB::table('students')->insert([ 'id' => 10, 'school_id' => 1, 'parent_id' => 5, 'firstname' => 'Student', 'lastname' => 'One', 'dob' => '2015-01-01', 'age' => 10, 'gender' => 'Male', 'is_active' => 1, 'photo_consent' => 1, 'year_of_registration' => '2025', 'school_year' => '2024-2025', ]); DB::table('attendance_data')->insert([ 'class_id' => 1, 'class_section_id' => 1, 'student_id' => 10, 'school_id' => 'S1', 'date' => '2025-02-10', 'status' => 'absent', 'semester' => 'Spring', 'school_year' => '2024-2025', ]); $notifier = Mockery::mock(UserNotificationDispatchService::class); $notifier->shouldReceive('notifyUser')->once(); $email = Mockery::mock(EmailService::class); $email->shouldReceive('send')->once()->andReturn(true); $service = new AttendanceDailySummaryService($notifier, $email); $count = $service->sendAbsenteesSummary(); $this->assertSame(1, $count); } }