<?php

declare(strict_types=1);

namespace Ferienpass\CoreBundle\Tests\Entity;

use Ferienpass\CoreBundle\Entity\Participant\BaseParticipant;
use Ferienpass\CoreBundle\Entity\PhotoPermission;
use Ferienpass\CoreBundle\Entity\User;
use PHPUnit\Framework\TestCase;

final class PhotoPermissionTest extends TestCase
{
    public function testConstructorSetsUserAndParticipant(): void
    {
        $user = new User();
        $participant = new BaseParticipant();
        $permission = new PhotoPermission($user, $participant);

        self::assertSame($user, $permission->getUser());
        self::assertSame($participant, $permission->getParticipant());
    }

    public function testCreatedAtIsSetOnConstruct(): void
    {
        $user = new User();
        $participant = new BaseParticipant();
        $permission = new PhotoPermission($user, $participant);

        self::assertInstanceOf(\DateTimeInterface::class, $permission->getCreatedAt());
    }
}
