infinito/application/tests/Unit/Entity/Attribut/PersonIdentitySourceAttributTest.php

42 lines
1.1 KiB
PHP
Raw Normal View History

<?php
namespace Tests\Unit\Entity\Attribut;
use PHPUnit\Framework\TestCase;
use App\Entity\Attribut\PersonIdentitySourceAttributInterface;
2018-11-15 19:55:03 +01:00
use App\Entity\Attribut\PersonIdentitySourceAttribut;
use App\Entity\Source\Data\PersonIdentitySourceInterface;
/**
* @todo Implement abstract test class for entity attributs
*
* @author kevinfrantz
*/
class PersonIdentitySourceAttributTest extends TestCase
{
/**
* @var PersonIdentitySourceAttributInterface
*/
protected $identity;
public function setUp(): void
{
$this->identity = new class() implements PersonIdentitySourceAttributInterface {
2018-11-15 19:55:03 +01:00
use PersonIdentitySourceAttribut;
};
}
public function testConstructor(): void
{
$this->expectException(\TypeError::class);
$this->identity->getIdentitySource();
}
public function testAccessors(): void
{
$identity = $this->createMock(PersonIdentitySourceInterface::class);
$this->assertNull($this->identity->setIdentitySource($identity));
$this->assertEquals($collection, $this->identity->getIdentitySource());
}
}