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

40 lines
1.1 KiB
PHP
Raw Normal View History

<?php
namespace Tests\Unit\Entity\Attribut;
use PHPUnit\Framework\TestCase;
2018-11-21 17:55:48 +01:00
use App\Entity\Source\Complex\FullPersonNameSourceInterface;
use App\Entity\Attribut\FullPersonNameSourceAttributInterface;
use App\Entity\Attribut\FullPersonNameSourceAttribut;
/**
* @author kevinfrantz
*/
class FullPersonNameSourceAttributTest extends TestCase
{
/**
* @var FullPersonNameSourceAttributInterface
*/
protected $fullname;
public function setUp(): void
{
$this->fullname = new class() implements FullPersonNameSourceAttributInterface {
use FullPersonNameSourceAttribut;
};
}
public function testConstructor(): void
{
$this->expectException(\TypeError::class);
$this->fullname->getFullPersonNameSource();
}
public function testAccessors(): void
{
$fullname = $this->createMock(FullPersonNameSourceInterface::class);
$this->assertNull($this->fullname->setFullPersonNameSource($fullname));
2018-11-10 13:09:18 +01:00
$this->assertEquals($fullname, $this->fullname->getFullPersonNameSource());
}
}