2018-11-10 13:09:18 +01:00
|
|
|
<?php
|
|
|
|
|
2019-01-20 10:41:58 +01:00
|
|
|
namespace Tests\Unit\Attribut;
|
2018-11-10 13:09:18 +01:00
|
|
|
|
2019-02-17 14:33:19 +01:00
|
|
|
use Infinito\Attribut\FirstNameSourceAttribut;
|
|
|
|
use Infinito\Attribut\FirstNameSourceAttributInterface;
|
|
|
|
use Infinito\Entity\Source\Primitive\Name\FirstNameSourceInterface;
|
2020-04-02 21:13:35 +02:00
|
|
|
use PHPUnit\Framework\TestCase;
|
2018-11-10 13:09:18 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @author kevinfrantz
|
|
|
|
*/
|
|
|
|
class FirstNameSourceAttributTest extends TestCase
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* @var FirstNameSourceAttributInterface
|
|
|
|
*/
|
|
|
|
protected $name;
|
|
|
|
|
|
|
|
public function setUp(): void
|
|
|
|
{
|
|
|
|
$this->name = new class() implements FirstNameSourceAttributInterface {
|
|
|
|
use FirstNameSourceAttribut;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
public function testConstructor(): void
|
|
|
|
{
|
|
|
|
$this->expectException(\TypeError::class);
|
|
|
|
$this->name->getFirstNameSource();
|
|
|
|
}
|
|
|
|
|
|
|
|
public function testAccessors(): void
|
|
|
|
{
|
|
|
|
$name = $this->createMock(FirstNameSourceInterface::class);
|
|
|
|
$this->assertNull($this->name->setFirstNameSource($name));
|
|
|
|
$this->assertEquals($name, $this->name->getFirstNameSource());
|
|
|
|
}
|
|
|
|
}
|