mirror of
https://github.com/kevinveenbirkenbach/infinito.git
synced 2025-01-10 14:27:28 +01:00
38 lines
1.1 KiB
PHP
38 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace Tests\Unit\Entity\Attribut;
|
|
|
|
use PHPUnit\Framework\TestCase;
|
|
use App\Entity\Attribut\MembershipsAttributInterface;
|
|
use App\Entity\Attribut\MembershipsAttribut;
|
|
use App\Entity\Source\Collection\MemberCollectionSourceInterface;
|
|
use Doctrine\Common\Collections\ArrayCollection;
|
|
|
|
class MembershipsAttributTest extends TestCase
|
|
{
|
|
/**
|
|
* @var MembershipsAttributInterface
|
|
*/
|
|
protected $memberships;
|
|
|
|
public function setUp(): void
|
|
{
|
|
$this->memberships = new class() implements MembershipsAttributInterface {
|
|
use MembershipsAttribut;
|
|
};
|
|
}
|
|
|
|
public function testConstructor(): void
|
|
{
|
|
$this->expectException(\TypeError::class);
|
|
$this->memberships->getMemberships();
|
|
}
|
|
|
|
public function testAccessors(): void
|
|
{
|
|
$membership = $this->createMock(MemberCollectionSourceInterface::class);
|
|
$this->assertNull($this->memberships->setMemberships(new ArrayCollection([$membership])));
|
|
$this->assertEquals($this->memberships->getMemberships()->get(0), $membership);
|
|
}
|
|
}
|