<?php

declare(strict_types=1);

namespace App\Tests\Unit\Administration\Domain\Model\Import;

use App\Administration\Domain\Model\Import\StudentImportField;
use PHPUnit\Framework\Attributes\Test;
use PHPUnit\Framework\TestCase;

final class StudentImportFieldTest extends TestCase
{
    #[Test]
    public function champsObligatoiresReturnsRequiredFields(): void
    {
        $required = StudentImportField::champsObligatoires();

        self::assertCount(3, $required);
        self::assertContains(StudentImportField::LAST_NAME, $required);
        self::assertContains(StudentImportField::FIRST_NAME, $required);
        self::assertContains(StudentImportField::CLASS_NAME, $required);
    }

    #[Test]
    public function estObligatoireForRequiredFields(): void
    {
        self::assertTrue(StudentImportField::LAST_NAME->estObligatoire());
        self::assertTrue(StudentImportField::FIRST_NAME->estObligatoire());
        self::assertTrue(StudentImportField::CLASS_NAME->estObligatoire());
    }

    #[Test]
    public function estObligatoireFalseForOptionalFields(): void
    {
        self::assertFalse(StudentImportField::EMAIL->estObligatoire());
        self::assertFalse(StudentImportField::BIRTH_DATE->estObligatoire());
        self::assertFalse(StudentImportField::GENDER->estObligatoire());
        self::assertFalse(StudentImportField::STUDENT_NUMBER->estObligatoire());
    }

    #[Test]
    public function labelReturnsReadableText(): void
    {
        self::assertSame('Nom', StudentImportField::LAST_NAME->label());
        self::assertSame('Prénom', StudentImportField::FIRST_NAME->label());
        self::assertSame('Classe', StudentImportField::CLASS_NAME->label());
        self::assertSame('Email', StudentImportField::EMAIL->label());
    }
}
