From 00ae6412e62139d0b75873f096a4d4aec6570935 Mon Sep 17 00:00:00 2001 From: Kevin Frantz Date: Sun, 4 Nov 2018 12:24:52 +0100 Subject: [PATCH] Implemented some tests for UserSource and deleted unnecessary attributs --- .../Entity/Attribut/NameSourceAttribut.php | 2 +- .../Attribut/NameSourceAttributInterface.php | 2 +- .../Entity/Attribut/UserSourceAttribut.php | 28 ------------------- .../Attribut/UserSourceAttributInterface.php | 15 ---------- .../src/Entity/Attribut/UsernameAttribut.php | 26 ----------------- .../Entity/Source/Data/UserSourceTest.php | 27 ++++++++++++++++++ 6 files changed, 29 insertions(+), 71 deletions(-) delete mode 100644 application/src/Entity/Attribut/UserSourceAttribut.php delete mode 100644 application/src/Entity/Attribut/UserSourceAttributInterface.php delete mode 100644 application/src/Entity/Attribut/UsernameAttribut.php create mode 100644 application/tests/Unit/Entity/Source/Data/UserSourceTest.php diff --git a/application/src/Entity/Attribut/NameSourceAttribut.php b/application/src/Entity/Attribut/NameSourceAttribut.php index 4f493e7..4e5de3e 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\NameSourceInterface; +use App\Entity\Source\Data\NameSourceInterface; /** * @author kevinfrantz diff --git a/application/src/Entity/Attribut/NameSourceAttributInterface.php b/application/src/Entity/Attribut/NameSourceAttributInterface.php index a7d0a8e..5debcaa 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\NameSourceInterface; +use App\Entity\Source\Data\NameSourceInterface; /** * @author kevinfrantz diff --git a/application/src/Entity/Attribut/UserSourceAttribut.php b/application/src/Entity/Attribut/UserSourceAttribut.php deleted file mode 100644 index e66f2ff..0000000 --- a/application/src/Entity/Attribut/UserSourceAttribut.php +++ /dev/null @@ -1,28 +0,0 @@ -user = $userSource; - } - - public function getUserSource(): UserSourceInterface - { - return $this->userSource; - } -} diff --git a/application/src/Entity/Attribut/UserSourceAttributInterface.php b/application/src/Entity/Attribut/UserSourceAttributInterface.php deleted file mode 100644 index e543cad..0000000 --- a/application/src/Entity/Attribut/UserSourceAttributInterface.php +++ /dev/null @@ -1,15 +0,0 @@ -username; - } - - public function setUsername(string $username): void - { - $this->username = \trim($username); - } -} diff --git a/application/tests/Unit/Entity/Source/Data/UserSourceTest.php b/application/tests/Unit/Entity/Source/Data/UserSourceTest.php new file mode 100644 index 0000000..8fa4324 --- /dev/null +++ b/application/tests/Unit/Entity/Source/Data/UserSourceTest.php @@ -0,0 +1,27 @@ +userSource = new UserSource(); + } + + public function testConstructor():void { + $this->assertInstanceOf(Collection::class, $this->userSource->getMemberships()); + $this->assertInstanceOf(NameSourceInterface::class, $this->userSource->getNameSource()); + } +} +