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

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