<?php

declare(strict_types=1);

/*
 * This file is part of the Ferienpass package.
 *
 * (c) Richard Henkenjohann <richard@ferienpass.online>
 *
 * For more information visit the project website <https://ferienpass.online>
 * or the documentation under <https://docs.ferienpass.online>.
 */

namespace Ferienpass\CoreBundle\Tests\Entity;

use Ferienpass\CoreBundle\Entity\Host;
use Ferienpass\CoreBundle\Entity\HostMemberAssociation;
use Ferienpass\CoreBundle\Entity\User;
use PHPUnit\Framework\TestCase;

final class HostMemberAssociationTest extends TestCase
{
    public function testConstructWithUserAndHost(): void
    {
        $user = new User();
        $host = new Host();

        $association = new HostMemberAssociation($user, $host);

        self::assertSame($user, $association->getUser());
        self::assertSame($host, $association->getHost());
    }

    public function testGetCreatedAtIsSetOnConstruct(): void
    {
        $association = new HostMemberAssociation(new User(), new Host());

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