<?php

declare(strict_types=1);

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

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

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

        self::assertCount(3, $required);
        self::assertContains(TeacherImportField::LAST_NAME, $required);
        self::assertContains(TeacherImportField::FIRST_NAME, $required);
        self::assertContains(TeacherImportField::EMAIL, $required);
    }

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

    #[Test]
    public function estObligatoireFalseForOptionalFields(): void
    {
        self::assertFalse(TeacherImportField::SUBJECTS->estObligatoire());
        self::assertFalse(TeacherImportField::CLASSES->estObligatoire());
    }

    #[Test]
    public function estMultiValeurForMultiValueFields(): void
    {
        self::assertTrue(TeacherImportField::SUBJECTS->estMultiValeur());
        self::assertTrue(TeacherImportField::CLASSES->estMultiValeur());
    }

    #[Test]
    public function estMultiValeurFalseForSingleValueFields(): void
    {
        self::assertFalse(TeacherImportField::LAST_NAME->estMultiValeur());
        self::assertFalse(TeacherImportField::FIRST_NAME->estMultiValeur());
        self::assertFalse(TeacherImportField::EMAIL->estMultiValeur());
    }

    #[Test]
    public function labelReturnsReadableText(): void
    {
        self::assertSame('Nom', TeacherImportField::LAST_NAME->label());
        self::assertSame('Prénom', TeacherImportField::FIRST_NAME->label());
        self::assertSame('Email', TeacherImportField::EMAIL->label());
        self::assertSame('Matières', TeacherImportField::SUBJECTS->label());
        self::assertSame('Classes', TeacherImportField::CLASSES->label());
    }

    #[Test]
    public function allCasesExist(): void
    {
        $cases = TeacherImportField::cases();

        self::assertCount(5, $cases);
    }
}
