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;
|
|
|
|
use App\Entity\Source\Data\IdentityInterface;
|
|
|
|
use App\Entity\Source\Data\IdentitySource;
|
|
|
|
use App\Entity\Source\Data\FullPersonNameSourceInterface;
|
|
|
|
|
|
|
|
class IdentitySourceTest extends TestCase
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* @var IdentityInterface
|
|
|
|
*/
|
|
|
|
protected $identity;
|
2018-11-10 12:30:59 +01:00
|
|
|
|
|
|
|
public function setUp(): void
|
|
|
|
{
|
2018-11-10 17:25:48 +01:00
|
|
|
$this->identity = new IdentitySource();
|
|
|
|
}
|
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
|
|
|
|
|
|
|
public function testName(): void
|
|
|
|
{
|
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());
|
|
|
|
}
|
|
|
|
}
|