<?php

namespace Tests\Unit\Services\Administrator;

use App\Services\Administrator\AdministratorEnrollmentQueryService;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Mockery;
use Tests\TestCase;

class AdministratorEnrollmentQueryServiceTest extends TestCase
{
    use RefreshDatabase;

    public function test_enrollment_withdrawal_data_returns_structure(): void
    {
        $shared = Mockery::mock(\App\Services\Administrator\AdministratorSharedService::class);
        $shared->shouldReceive('getSchoolYear')->andReturn('2025-2026');
        $shared->shouldReceive('getSemester')->andReturn('Fall');
        $shared->shouldReceive('getSchoolYearStartYear')->andReturn(2025);

        $service = new AdministratorEnrollmentQueryService(
            $shared,
            new \App\Models\Student(),
            new \App\Models\StudentClass(),
            new \App\Models\Enrollment(),
            new \App\Models\ClassSection()
        );

        $data = $service->enrollmentWithdrawalData('2025-2026');

        $this->assertArrayHasKey('students', $data);
        $this->assertArrayHasKey('classes', $data);
    }
}
