shouldReceive('getConfig')->with('semester')->andReturn('Fall'); $config->shouldReceive('getConfig')->with('school_year')->andReturn('2025-2026'); return new AttendanceTrackingService( $student, $studentClass, $attendanceData, $tracking, $config, $mailer, $rules, $parents, $composer, $log, $resolver, $caseQuery, $workflow, $support, $pending ); } public function test_get_pending_violations_delegates_to_pending_service(): void { $pending = Mockery::mock(AttendancePendingViolationService::class); $pending->shouldReceive('getPendingViolations') ->once() ->with('2025-2026', null, null) ->andReturn(['students' => []]); $service = $this->makeService(pending: $pending); $result = $service->getPendingViolations(); $this->assertSame(['students' => []], $result); } public function test_get_student_case_delegates_to_case_query_service(): void { $caseQuery = Mockery::mock(AttendanceCaseQueryService::class); $caseQuery->shouldReceive('getStudentCase') ->once() ->andReturn(['success' => true]); $service = $this->makeService(caseQuery: $caseQuery); $result = $service->getStudentCase(1); $this->assertTrue($result['success']); } public function test_record_delegates_to_workflow_service(): void { $workflow = Mockery::mock(AttendanceNotificationWorkflowService::class); $workflow->shouldReceive('record') ->once() ->with(['student_id' => 10]) ->andReturn(['success' => true]); $service = $this->makeService(workflow: $workflow); $result = $service->record(['student_id' => 10]); $this->assertTrue($result['success']); } public function test_compose_delegates_to_support_service(): void { $support = Mockery::mock(AttendanceCommunicationSupportService::class); $support->shouldReceive('compose') ->once() ->with(10, 'ABS_1', 'default', null) ->andReturn(['success' => true]); $service = $this->makeService(support: $support); $result = $service->compose(10); $this->assertTrue($result['success']); } }