infinito/application/tests/Unit/Entity/Source/Data/PersonIdentitySourceTest.php

34 lines
897 B
PHP
Raw Normal View History

2018-11-10 17:25:48 +01:00
<?php
2018-11-10 17:25:48 +01:00
namespace tests\unit\Entity\Source\Data;
use PHPUnit\Framework\TestCase;
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
class PersonIdentitySourceTest extends TestCase
2018-11-10 17:25:48 +01:00
{
/**
* @var PersonIdentitySourceInterface
2018-11-10 17:25:48 +01:00
*/
protected $identity;
public function setUp(): void
{
$this->identity = new PersonIdentitySource();
2018-11-10 17:25:48 +01:00
}
public function testConstructor(): void
{
2018-11-10 17:25:48 +01:00
$this->assertInstanceOf(FullPersonNameSourceInterface::class, $this->identity->getName());
}
public function testFullName(): 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());
}
}