shouldReceive('getConfig')->with('semester')->andReturn('Fall'); $config->shouldReceive('getConfig')->with('school_year')->andReturn('2025-2026'); return new AttendanceCommunicationSupportService( $student, $attendanceData, $config, $parents, $composer ); } public function test_compose_returns_422_when_student_id_missing(): void { $service = $this->makeService(); $result = $service->compose(0); $this->assertFalse($result['success']); $this->assertSame(422, $result['status']); } public function test_parents_info_delegates_to_parent_lookup_service(): void { $parents = Mockery::mock(AttendanceParentLookupService::class); $parents->shouldReceive('parentsInfo') ->once() ->with(20, '2025-2026') ->andReturn(['success' => true, 'data' => ['primary' => [], 'secondary' => []]]); $service = $this->makeService( parents: $parents ); $result = $service->parentsInfo(20); $this->assertTrue($result['success']); } }