diff --git a/application/src/Entity/Attribut/NameSourceAttribut.php b/application/src/Entity/Attribut/NameSourceAttribut.php index 4e5de3e..369eb37 100644 --- a/application/src/Entity/Attribut/NameSourceAttribut.php +++ b/application/src/Entity/Attribut/NameSourceAttribut.php @@ -2,7 +2,7 @@ namespace App\Entity\Attribut; -use App\Entity\Source\Data\NameSourceInterface; +use App\Entity\Source\Data\Name\NameSourceInterface; /** * @author kevinfrantz diff --git a/application/src/Entity/Attribut/NameSourceAttributInterface.php b/application/src/Entity/Attribut/NameSourceAttributInterface.php index 5debcaa..1cf6762 100644 --- a/application/src/Entity/Attribut/NameSourceAttributInterface.php +++ b/application/src/Entity/Attribut/NameSourceAttributInterface.php @@ -2,7 +2,7 @@ namespace App\Entity\Attribut; -use App\Entity\Source\Data\NameSourceInterface; +use App\Entity\Source\Data\Name\NameSourceInterface; /** * @author kevinfrantz diff --git a/application/src/Entity/Attribut/PersonIdentitySourceAttribut.php b/application/src/Entity/Attribut/PersonIdentitySourceAttribut.php index 12459ee..5345e25 100644 --- a/application/src/Entity/Attribut/PersonIdentitySourceAttribut.php +++ b/application/src/Entity/Attribut/PersonIdentitySourceAttribut.php @@ -2,7 +2,7 @@ namespace App\Entity\Attribut; -use App\Entity\Source\Data\PersonIdentitySourceInterface; +use App\Entity\Source\Combination\PersonIdentitySourceInterface; trait PersonIdentitySourceAttribut { diff --git a/application/src/Entity/Attribut/PersonIdentitySourceAttributInterface.php b/application/src/Entity/Attribut/PersonIdentitySourceAttributInterface.php index 2039a6f..a759331 100644 --- a/application/src/Entity/Attribut/PersonIdentitySourceAttributInterface.php +++ b/application/src/Entity/Attribut/PersonIdentitySourceAttributInterface.php @@ -2,7 +2,7 @@ namespace App\Entity\Attribut; -use App\Entity\Source\Data\PersonIdentitySourceInterface; +use App\Entity\Source\Combination\PersonIdentitySourceInterface; interface PersonIdentitySourceAttributInterface { diff --git a/application/src/Entity/Source/Combination/PersonIdentitySource.php b/application/src/Entity/Source/Combination/PersonIdentitySource.php index f1c827f..bbd57d9 100644 --- a/application/src/Entity/Source/Combination/PersonIdentitySource.php +++ b/application/src/Entity/Source/Combination/PersonIdentitySource.php @@ -1,10 +1,9 @@ personIdentitySource = new PersonIdentitySource(); parent::__construct(); } } diff --git a/application/tests/Unit/Entity/Attribut/NameSourceAttributTest.php b/application/tests/Unit/Entity/Attribut/NameSourceAttributTest.php index 828a0ba..d1cfbb4 100644 --- a/application/tests/Unit/Entity/Attribut/NameSourceAttributTest.php +++ b/application/tests/Unit/Entity/Attribut/NameSourceAttributTest.php @@ -5,7 +5,7 @@ namespace tests\unit\Entity\Attribut; use PHPUnit\Framework\TestCase; use App\Entity\Attribut\NameSourceAttributInterface; use App\Entity\Attribut\NameSourceAttribut; -use App\Entity\Source\Data\NameSourceInterface; +use App\Entity\Source\Data\Name\NameSourceInterface; class NameSourceAttributTest extends TestCase { diff --git a/application/tests/Unit/Entity/Attribut/PersonIdentitySourceAttributTest.php b/application/tests/Unit/Entity/Attribut/PersonIdentitySourceAttributTest.php index 38b599f..8257bbb 100644 --- a/application/tests/Unit/Entity/Attribut/PersonIdentitySourceAttributTest.php +++ b/application/tests/Unit/Entity/Attribut/PersonIdentitySourceAttributTest.php @@ -5,7 +5,7 @@ namespace Tests\Unit\Entity\Attribut; use PHPUnit\Framework\TestCase; use App\Entity\Attribut\PersonIdentitySourceAttributInterface; use App\Entity\Attribut\PersonIdentitySourceAttribut; -use App\Entity\Source\Data\PersonIdentitySourceInterface; +use App\Entity\Source\Combination\PersonIdentitySourceInterface; /** * @todo Implement abstract test class for entity attributs @@ -29,13 +29,13 @@ class PersonIdentitySourceAttributTest extends TestCase public function testConstructor(): void { $this->expectException(\TypeError::class); - $this->identity->getIdentitySource(); + $this->identity->getPersonIdentitySource(); } public function testAccessors(): void { $identity = $this->createMock(PersonIdentitySourceInterface::class); - $this->assertNull($this->identity->setIdentitySource($identity)); - $this->assertEquals($collection, $this->identity->getIdentitySource()); + $this->assertNull($this->identity->setPersonIdentitySource($identity)); + $this->assertEquals($identity, $this->identity->getPersonIdentitySource()); } } diff --git a/application/tests/Unit/Entity/Source/Combination/PersonIdentitySourceTest.php b/application/tests/Unit/Entity/Source/Combination/PersonIdentitySourceTest.php index 6d370e0..807ff45 100644 --- a/application/tests/Unit/Entity/Source/Combination/PersonIdentitySourceTest.php +++ b/application/tests/Unit/Entity/Source/Combination/PersonIdentitySourceTest.php @@ -3,8 +3,8 @@ namespace tests\unit\Entity\Source\Combination; use PHPUnit\Framework\TestCase; -use App\Entity\Source\Data\PersonIdentitySourceInterface; -use App\Entity\Source\Data\PersonIdentitySource; +use App\Entity\Source\Combination\PersonIdentitySourceInterface; +use App\Entity\Source\Combination\PersonIdentitySource; use App\Entity\Source\Combination\FullPersonNameSourceInterface; class PersonIdentitySourceTest extends TestCase @@ -12,15 +12,22 @@ class PersonIdentitySourceTest extends TestCase /** * @var PersonIdentitySourceInterface */ - public $identitySource; + protected $identity; public function setUp(): void { - $this->userSource = new PersonIdentitySource(); + $this->identity = new PersonIdentitySource(); } public function testConstructor(): void { - $this->assertInstanceOf(FullPersonNameSourceInterface::class, $this->identitySource->getFullPersonNameSource()); + $this->assertInstanceOf(FullPersonNameSourceInterface::class, $this->identity->getFullPersonNameSource()); + } + + public function testFullName(): void + { + $name = $this->createMock(FullPersonNameSourceInterface::class); + $this->assertNull($this->identity->setFullPersonNameSource($name)); + $this->assertEquals($name, $this->identity->getFullPersonNameSource()); } } diff --git a/application/tests/Unit/Entity/Source/Combination/UserSourceTest.php b/application/tests/Unit/Entity/Source/Combination/UserSourceTest.php index 09568f7..f3f6019 100644 --- a/application/tests/Unit/Entity/Source/Combination/UserSourceTest.php +++ b/application/tests/Unit/Entity/Source/Combination/UserSourceTest.php @@ -6,7 +6,7 @@ use PHPUnit\Framework\TestCase; use App\Entity\Source\Combination\UserSourceInterface; use App\Entity\Source\Combination\UserSource; use Doctrine\Common\Collections\Collection; -use App\Entity\Source\Data\PersonIdentitySourceInterface; +use App\Entity\Source\Combination\PersonIdentitySourceInterface; class UserSourceTest extends TestCase { @@ -23,7 +23,7 @@ class UserSourceTest extends TestCase public function testConstructor(): void { $this->assertInstanceOf(Collection::class, $this->userSource->getMemberships()); - $this->assertInstanceOf(PersonIdentitySourceInterface::class, $this->userSource->getIdentitySource()); + $this->assertInstanceOf(PersonIdentitySourceInterface::class, $this->userSource->getPersonIdentitySource()); $this->expectException(\TypeError::class); $this->userSource->getUser(); } diff --git a/application/tests/Unit/Entity/Source/Data/NameSourceTest.php b/application/tests/Unit/Entity/Source/Data/Name/AbstractNameSourceTest.php similarity index 73% rename from application/tests/Unit/Entity/Source/Data/NameSourceTest.php rename to application/tests/Unit/Entity/Source/Data/Name/AbstractNameSourceTest.php index e699048..e7d4ba9 100644 --- a/application/tests/Unit/Entity/Source/Data/NameSourceTest.php +++ b/application/tests/Unit/Entity/Source/Data/Name/AbstractNameSourceTest.php @@ -3,13 +3,13 @@ namespace tests\unit\Entity\Source\Data; use PHPUnit\Framework\TestCase; -use App\Entity\Source\Data\NameSourceInterface; -use App\Entity\Source\Data\NameSource; +use App\Entity\Source\Data\Name\NameSourceInterface; +use App\Entity\Source\Data\Name\AbstractNameSource; /** * @author kevinfrantz */ -class NameSourceTest extends TestCase +class AbstractNameSourceTest extends TestCase { /** * @var NameSourceInterface @@ -18,7 +18,8 @@ class NameSourceTest extends TestCase public function setUp(): void { - $this->nameSource = new NameSource(); + $this->nameSource = new class() extends AbstractNameSource { + }; } public function testConstructor(): void diff --git a/application/tests/Unit/Entity/Source/Data/PersonIdentitySourceTest.php b/application/tests/Unit/Entity/Source/Data/PersonIdentitySourceTest.php deleted file mode 100644 index c5c4ce5..0000000 --- a/application/tests/Unit/Entity/Source/Data/PersonIdentitySourceTest.php +++ /dev/null @@ -1,33 +0,0 @@ -identity = new PersonIdentitySource(); - } - - public function testConstructor(): void - { - $this->assertInstanceOf(FullPersonNameSourceInterface::class, $this->identity->getName()); - } - - public function testFullName(): void - { - $name = $this->createMock(FullPersonNameSourceInterface::class); - $this->assertNull($this->identity->setName($name)); - $this->assertEquals($name, $this->identity->getName()); - } -} diff --git a/application/tests/Unit/Entity/UserTest.php b/application/tests/Unit/Entity/UserTest.php index eb9ba1a..a9f0d0e 100644 --- a/application/tests/Unit/Entity/UserTest.php +++ b/application/tests/Unit/Entity/UserTest.php @@ -4,7 +4,7 @@ namespace tests\unit\Entity; use PHPUnit\Framework\TestCase; use App\Entity\User; -use App\Entity\Source\Data\UserSource; +use App\Entity\Source\Combination\UserSource; use App\Entity\UserInterface; /**