<?php

namespace Tests\Unit\Services\Administrator;

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

class AdministratorEnrollmentStatusServiceTest extends TestCase
{
    use RefreshDatabase;

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

        $refundService = Mockery::mock(\App\Services\Administrator\AdministratorEnrollmentRefundService::class);
        $eventService = Mockery::mock(\App\Services\Administrator\AdministratorEnrollmentEventService::class);

        $service = new AdministratorEnrollmentStatusService(
            $shared,
            new \App\Models\Student(),
            new \App\Models\User(),
            $refundService,
            $eventService
        );

        $result = $service->updateStatuses([], 1);

        $this->assertFalse($result['success']);
        $this->assertSame(422, $result['status']);
    }
}
