From 14fff41c96c39a425d1f8919b3cc8a8b29ef7fcc Mon Sep 17 00:00:00 2001 From: Kevin Frantz Date: Sat, 14 Jul 2018 14:15:36 +0200 Subject: [PATCH] Implemented UniqueInterface, User and tests --- src/entity/UniqueInterface.php | 22 ++++++++++++++++++++++ src/entity/order/OrderInterface.php | 10 ++-------- src/entity/product/ProductInterface.php | 10 ++-------- src/entity/user/User.php | 16 ++++++++++++++++ src/entity/user/UserInterface.php | 4 +++- src/entity/user/UserTest.php | 6 ++++++ 6 files changed, 51 insertions(+), 17 deletions(-) create mode 100644 src/entity/UniqueInterface.php diff --git a/src/entity/UniqueInterface.php b/src/entity/UniqueInterface.php new file mode 100644 index 0000000..4a1ca0a --- /dev/null +++ b/src/entity/UniqueInterface.php @@ -0,0 +1,22 @@ +email; } + public function setId(int $id): void + { + $this->id = $id; + } + + public function getId(): int + { + return $this->id; + } + } diff --git a/src/entity/user/UserInterface.php b/src/entity/user/UserInterface.php index de2b892..6667fd8 100644 --- a/src/entity/user/UserInterface.php +++ b/src/entity/user/UserInterface.php @@ -1,6 +1,8 @@ user->setName(self::NAME); $this->user->setEmail(self::EMAIL); $this->user->setPasswordHash(self::HASH); + $this->user->setId(self::ID); } public function testName():void{ @@ -40,5 +43,8 @@ class UserTest extends TestCase $this->assertEquals(self::HASH, $this->user->getPasswordHash()); } + public function testId():void{ + $this->assertEquals(self::ID, $this->user->getId()); + } }