<?php

declare(strict_types=1);

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

use App\Administration\Domain\Model\Invitation\ParentInvitationId;
use PHPUnit\Framework\Attributes\Test;
use PHPUnit\Framework\TestCase;

final class ParentInvitationIdTest extends TestCase
{
    #[Test]
    public function generateCreatesUniqueIds(): void
    {
        $id1 = ParentInvitationId::generate();
        $id2 = ParentInvitationId::generate();

        self::assertFalse($id1->equals($id2));
    }

    #[Test]
    public function fromStringCreatesIdFromString(): void
    {
        $uuid = '550e8400-e29b-41d4-a716-446655440001';

        $id = ParentInvitationId::fromString($uuid);

        self::assertSame($uuid, (string) $id);
    }

    #[Test]
    public function equalsReturnsTrueForSameId(): void
    {
        $uuid = '550e8400-e29b-41d4-a716-446655440001';
        $id1 = ParentInvitationId::fromString($uuid);
        $id2 = ParentInvitationId::fromString($uuid);

        self::assertTrue($id1->equals($id2));
    }
}
