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

42 lines
1.1 KiB
PHP
Raw Permalink Normal View History

<?php
2019-01-20 10:41:58 +01:00
namespace Tests\Unit\Attribut;
use Infinito\Attribut\PersonIdentitySourceAttribut;
2020-04-02 21:13:35 +02:00
use Infinito\Attribut\PersonIdentitySourceAttributInterface;
use Infinito\Entity\Source\Complex\PersonIdentitySourceInterface;
2020-04-02 21:13:35 +02:00
use PHPUnit\Framework\TestCase;
/**
* @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);
2018-11-15 20:30:34 +01:00
$this->identity->getPersonIdentitySource();
}
public function testAccessors(): void
{
$identity = $this->createMock(PersonIdentitySourceInterface::class);
2018-11-15 20:30:34 +01:00
$this->assertNull($this->identity->setPersonIdentitySource($identity));
$this->assertEquals($identity, $this->identity->getPersonIdentitySource());
}
}