2018-11-10 17:25:48 +01:00
|
|
|
<?php
|
2018-11-10 12:30:59 +01:00
|
|
|
|
2018-11-10 17:25:48 +01:00
|
|
|
namespace tests\unit\Entity\Source\Data;
|
|
|
|
|
|
|
|
use PHPUnit\Framework\TestCase;
|
2018-11-11 20:43:30 +01:00
|
|
|
use App\Entity\Source\Data\PersonIdentitySourceInterface;
|
|
|
|
use App\Entity\Source\Data\PersonIdentitySource;
|
|
|
|
use App\Entity\Source\Combination\FullPersonNameSourceInterface;
|
2018-11-10 17:25:48 +01:00
|
|
|
|
2018-11-11 20:43:30 +01:00
|
|
|
class PersonIdentitySourceTest extends TestCase
|
2018-11-10 17:25:48 +01:00
|
|
|
{
|
|
|
|
/**
|
2018-11-11 20:43:30 +01:00
|
|
|
* @var PersonIdentitySourceInterface
|
2018-11-10 17:25:48 +01:00
|
|
|
*/
|
|
|
|
protected $identity;
|
2018-11-10 12:30:59 +01:00
|
|
|
|
|
|
|
public function setUp(): void
|
|
|
|
{
|
2018-11-11 20:43:30 +01:00
|
|
|
$this->identity = new PersonIdentitySource();
|
2018-11-10 17:25:48 +01:00
|
|
|
}
|
2018-11-10 12:30:59 +01:00
|
|
|
|
|
|
|
public function testConstructor(): void
|
|
|
|
{
|
2018-11-10 17:25:48 +01:00
|
|
|
$this->assertInstanceOf(FullPersonNameSourceInterface::class, $this->identity->getName());
|
|
|
|
}
|
2018-11-10 12:30:59 +01:00
|
|
|
|
2018-11-11 20:43:30 +01:00
|
|
|
public function testFullName(): void
|
2018-11-10 12:30:59 +01:00
|
|
|
{
|
2018-11-10 17:25:48 +01:00
|
|
|
$name = $this->createMock(FullPersonNameSourceInterface::class);
|
|
|
|
$this->assertNull($this->identity->setName($name));
|
|
|
|
$this->assertEquals($name, $this->identity->getName());
|
|
|
|
}
|
|
|
|
}
|