2018-11-04 12:24:52 +01:00
|
|
|
<?php
|
2018-11-04 12:25:53 +01:00
|
|
|
|
2018-11-10 12:30:59 +01:00
|
|
|
namespace tests\unit\Entity\Source\Combination;
|
2018-11-04 12:24:52 +01:00
|
|
|
|
|
|
|
use PHPUnit\Framework\TestCase;
|
2018-11-11 21:12:21 +01:00
|
|
|
use App\Entity\Source\Combination\UserSourceInterface;
|
|
|
|
use App\Entity\Source\Combination\UserSource;
|
2018-11-04 12:24:52 +01:00
|
|
|
use Doctrine\Common\Collections\Collection;
|
2018-11-10 12:30:59 +01:00
|
|
|
use App\Entity\Source\Data\PersonIdentitySourceInterface;
|
2018-11-04 12:24:52 +01:00
|
|
|
|
|
|
|
class UserSourceTest extends TestCase
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* @var UserSourceInterface
|
|
|
|
*/
|
|
|
|
public $userSource;
|
2018-11-04 12:25:53 +01:00
|
|
|
|
|
|
|
public function setUp(): void
|
|
|
|
{
|
2018-11-04 12:24:52 +01:00
|
|
|
$this->userSource = new UserSource();
|
|
|
|
}
|
2018-11-04 12:25:53 +01:00
|
|
|
|
|
|
|
public function testConstructor(): void
|
|
|
|
{
|
2018-11-04 12:24:52 +01:00
|
|
|
$this->assertInstanceOf(Collection::class, $this->userSource->getMemberships());
|
2018-11-10 12:30:59 +01:00
|
|
|
$this->assertInstanceOf(PersonIdentitySourceInterface::class, $this->userSource->getIdentitySource());
|
2018-11-04 12:40:57 +01:00
|
|
|
$this->expectException(\TypeError::class);
|
|
|
|
$this->userSource->getUser();
|
2018-11-04 12:24:52 +01:00
|
|
|
}
|
|
|
|
}
|