Continued drafting of fullpersonname

This commit is contained in:
Kevin Frantz
2018-11-10 13:09:18 +01:00
parent c1b073eba8
commit e57fd22f78
10 changed files with 133 additions and 24 deletions

View File

@@ -0,0 +1,39 @@
<?php
namespace Tests\Unit\Entity\Attribut;
use PHPUnit\Framework\TestCase;
use App\Entity\Attribut\FirstNameSourceAttribut;
use App\Entity\Attribut\FirstNameSourceAttributInterface;
use App\Entity\Source\Data\Name\FirstNameSourceInterface;
/**
* @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());
}
}

View File

@@ -34,6 +34,6 @@ class FullPersonNameSourceAttributTest extends TestCase
{
$fullname = $this->createMock(FullPersonNameSourceInterface::class);
$this->assertNull($this->fullname->setFullPersonNameSource($fullname));
$this->assertEquals($collection, $this->fullname->getFullPersonNameSource());
$this->assertEquals($fullname, $this->fullname->getFullPersonNameSource());
}
}