infinito/application/tests/Unit/Entity/Source/GroupSourceTest.php

36 lines
884 B
PHP
Raw Normal View History

2018-10-28 22:31:56 +01:00
<?php
2018-10-29 19:01:00 +01:00
2018-10-28 22:31:56 +01:00
namespace tests\unit\Entity\Source;
use App\Entity\Source\GroupSourceInterface;
use App\Entity\Source\GroupSource;
use PHPUnit\Framework\TestCase;
use Doctrine\Common\Collections\Collection;
use Doctrine\Common\Collections\ArrayCollection;
use App\Entity\Source\AbstractSource;
/**
* @author kevinfrantz
*/
class GroupSourceTest extends TestCase
{
/**
* @var GroupSourceInterface
*/
protected $groupSource;
2018-10-29 19:01:00 +01:00
public function setUp(): void
{
2018-10-28 22:31:56 +01:00
$this->groupSource = new GroupSource();
}
2018-10-29 19:01:00 +01:00
public function testMembers()
{
2018-10-28 22:31:56 +01:00
$this->assertInstanceOf(Collection::class, $this->groupSource->getMembers());
2018-10-29 19:01:00 +01:00
$member = new class() extends AbstractSource {
};
2018-10-28 22:31:56 +01:00
$this->groupSource->setMembers(new ArrayCollection([$member]));
$this->assertEquals($member, $this->groupSource->getMembers()->get(0));
}
}