mirror of
https://github.com/kevinveenbirkenbach/infinito.git
synced 2025-09-13 13:57:10 +02:00
Continued the integration of person identity
This commit is contained in:
@@ -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();
|
||||
}
|
@@ -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());
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user