Continued the integration of person identity

This commit is contained in:
Kevin Frantz
2018-11-10 12:30:59 +01:00
parent 7a6a5e1bcf
commit c1b073eba8
21 changed files with 206 additions and 52 deletions

View File

@@ -1,12 +1,12 @@
<?php
namespace tests\unit\Entity\Source\Data;
namespace tests\unit\Entity\Source\Combination;
use PHPUnit\Framework\TestCase;
use App\Entity\Source\Data\UserSourceInterface;
use App\Entity\Source\Data\UserSource;
use Doctrine\Common\Collections\Collection;
use App\Entity\Source\Data\NameSourceInterface;
use App\Entity\Source\Data\PersonIdentitySourceInterface;
class UserSourceTest extends TestCase
{
@@ -23,7 +23,7 @@ class UserSourceTest extends TestCase
public function testConstructor(): void
{
$this->assertInstanceOf(Collection::class, $this->userSource->getMemberships());
$this->assertInstanceOf(NameSourceInterface::class, $this->userSource->getNameSource());
$this->assertInstanceOf(PersonIdentitySourceInterface::class, $this->userSource->getIdentitySource());
$this->expectException(\TypeError::class);
$this->userSource->getUser();
}

View File

@@ -1,4 +1,5 @@
<?php
namespace tests\unit\Entity\Source\Data;
use PHPUnit\Framework\TestCase;
@@ -12,19 +13,21 @@ class IdentitySourceTest extends TestCase
* @var IdentityInterface
*/
protected $identity;
public function setUp():void{
public function setUp(): void
{
$this->identity = new IdentitySource();
}
public function testConstructor():void{
public function testConstructor(): void
{
$this->assertInstanceOf(FullPersonNameSourceInterface::class, $this->identity->getName());
}
public function testName():void{
public function testName(): void
{
$name = $this->createMock(FullPersonNameSourceInterface::class);
$this->assertNull($this->identity->setName($name));
$this->assertEquals($name, $this->identity->getName());
}
}