2018-11-10 12:30:59 +01:00
|
|
|
<?php
|
|
|
|
|
2019-01-20 10:41:58 +01:00
|
|
|
namespace Tests\Unit\Attribut;
|
2018-11-10 12:30:59 +01:00
|
|
|
|
|
|
|
use PHPUnit\Framework\TestCase;
|
2019-02-17 14:33:19 +01:00
|
|
|
use Infinito\Attribut\PersonIdentitySourceAttributInterface;
|
|
|
|
use Infinito\Attribut\PersonIdentitySourceAttribut;
|
|
|
|
use Infinito\Entity\Source\Complex\PersonIdentitySourceInterface;
|
2018-11-10 12:30:59 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @todo Implement abstract test class for entity attributs
|
|
|
|
*
|
|
|
|
* @author kevinfrantz
|
|
|
|
*/
|
|
|
|
class PersonIdentitySourceAttributTest extends TestCase
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* @var PersonIdentitySourceAttributInterface
|
|
|
|
*/
|
|
|
|
protected $identity;
|
|
|
|
|
|
|
|
public function setUp(): void
|
|
|
|
{
|
|
|
|
$this->identity = new class() implements PersonIdentitySourceAttributInterface {
|
2018-11-15 19:55:03 +01:00
|
|
|
use PersonIdentitySourceAttribut;
|
2018-11-10 12:30:59 +01:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
public function testConstructor(): void
|
|
|
|
{
|
|
|
|
$this->expectException(\TypeError::class);
|
2018-11-15 20:30:34 +01:00
|
|
|
$this->identity->getPersonIdentitySource();
|
2018-11-10 12:30:59 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
public function testAccessors(): void
|
|
|
|
{
|
|
|
|
$identity = $this->createMock(PersonIdentitySourceInterface::class);
|
2018-11-15 20:30:34 +01:00
|
|
|
$this->assertNull($this->identity->setPersonIdentitySource($identity));
|
|
|
|
$this->assertEquals($identity, $this->identity->getPersonIdentitySource());
|
2018-11-10 12:30:59 +01:00
|
|
|
}
|
|
|
|
}
|