2018-11-04 12:49:42 +01:00
|
|
|
<?php
|
|
|
|
|
2019-01-20 10:41:58 +01:00
|
|
|
namespace tests\unit\Attribut;
|
2018-11-04 12:49:42 +01:00
|
|
|
|
|
|
|
use PHPUnit\Framework\TestCase;
|
2019-02-17 14:33:19 +01:00
|
|
|
use Infinito\Attribut\NameSourceAttributInterface;
|
|
|
|
use Infinito\Attribut\NameSourceAttribut;
|
|
|
|
use Infinito\Entity\Source\Primitive\Name\NameSourceInterface;
|
2018-11-04 12:49:42 +01:00
|
|
|
|
|
|
|
class NameSourceAttributTest extends TestCase
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* @var NameSourceAttributInterface
|
|
|
|
*/
|
|
|
|
protected $name;
|
|
|
|
|
|
|
|
public function setUp(): void
|
|
|
|
{
|
|
|
|
$this->name = new class() implements NameSourceAttributInterface {
|
|
|
|
use NameSourceAttribut;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
public function testConstructor(): void
|
|
|
|
{
|
|
|
|
$this->expectException(\TypeError::class);
|
|
|
|
$this->name->getNameSource();
|
|
|
|
}
|
|
|
|
|
|
|
|
public function testAccessors(): void
|
|
|
|
{
|
|
|
|
$nameSource = $this->createMock(NameSourceInterface::class);
|
|
|
|
$this->assertNull($this->name->setNameSource($nameSource));
|
|
|
|
$this->assertEquals($nameSource, $this->name->getNameSource());
|
|
|
|
}
|
|
|
|
}
|