From 7a6a5e1bcf2bb9da5057624862c26af66a57ea64 Mon Sep 17 00:00:00 2001 From: Kevin Frantz Date: Sat, 10 Nov 2018 17:25:48 +0100 Subject: [PATCH] Added draft for Identity and Names --- .../Combination/AbstractCombinationSource.php | 8 +++++ .../CombinationSourceInterface.php | 9 ++++++ .../FullPersonNameSourceInterface.php | 21 +++++++++++++ .../Source/Combination/IdentityInterface.php | 8 +++++ .../Source/Combination/IdentitySource.php | 8 +++++ .../{Data => Combination}/UserSource.php | 0 .../UserSourceInterface.php | 0 .../Source/Data/Name/AbstractNameSource.php | 9 ++++++ .../Data/Name/FirstNameSourceInterface.php | 7 +++++ .../Source/Data/Name/NameSourceInterface.php | 9 ++++++ .../NicknameSource.php} | 6 ++-- .../Data/Name/NicknameSourceInterface.php | 10 +++++++ .../Data/Name/SurnameSourceInterface.php | 7 +++++ .../Source/Data/NameSourceInterface.php | 12 -------- .../Entity/Source/Data/IdentitySourceTest.php | 30 +++++++++++++++++++ 15 files changed, 129 insertions(+), 15 deletions(-) create mode 100644 application/src/Entity/Source/Combination/AbstractCombinationSource.php create mode 100644 application/src/Entity/Source/Combination/CombinationSourceInterface.php create mode 100644 application/src/Entity/Source/Combination/FullPersonNameSourceInterface.php create mode 100644 application/src/Entity/Source/Combination/IdentityInterface.php create mode 100644 application/src/Entity/Source/Combination/IdentitySource.php rename application/src/Entity/Source/{Data => Combination}/UserSource.php (100%) rename application/src/Entity/Source/{Data => Combination}/UserSourceInterface.php (100%) create mode 100644 application/src/Entity/Source/Data/Name/AbstractNameSource.php create mode 100644 application/src/Entity/Source/Data/Name/FirstNameSourceInterface.php create mode 100644 application/src/Entity/Source/Data/Name/NameSourceInterface.php rename application/src/Entity/Source/Data/{NameSource.php => Name/NicknameSource.php} (74%) create mode 100644 application/src/Entity/Source/Data/Name/NicknameSourceInterface.php create mode 100644 application/src/Entity/Source/Data/Name/SurnameSourceInterface.php delete mode 100644 application/src/Entity/Source/Data/NameSourceInterface.php create mode 100644 application/tests/Unit/Entity/Source/Data/IdentitySourceTest.php diff --git a/application/src/Entity/Source/Combination/AbstractCombinationSource.php b/application/src/Entity/Source/Combination/AbstractCombinationSource.php new file mode 100644 index 0000000..c0816d2 --- /dev/null +++ b/application/src/Entity/Source/Combination/AbstractCombinationSource.php @@ -0,0 +1,8 @@ +identity = new IdentitySource(); + } + + public function testConstructor():void{ + $this->assertInstanceOf(FullPersonNameSourceInterface::class, $this->identity->getName()); + } + + public function testName():void{ + $name = $this->createMock(FullPersonNameSourceInterface::class); + $this->assertNull($this->identity->setName($name)); + $this->assertEquals($name, $this->identity->getName()); + } +} +