From e307c7e07eea2133e8b75994da35335df0dbbad9 Mon Sep 17 00:00:00 2001 From: Kevin Frantz Date: Sat, 14 Jul 2018 11:21:32 +0200 Subject: [PATCH] Added frames of entities and test for product --- src/entity/image/UrlImage.php | 21 ++++++++ src/entity/price/Price.php | 23 +++++++++ src/entity/product/Product.php | 46 +++++++++++++++++ src/entity/product/ProductInterface.php | 2 + src/entity/product/ProductTest.php | 68 +++++++++++++++++++++++++ src/entity/user/UserInterface.php | 5 -- 6 files changed, 160 insertions(+), 5 deletions(-) create mode 100644 src/entity/image/UrlImage.php create mode 100644 src/entity/price/Price.php create mode 100644 src/entity/product/Product.php create mode 100644 src/entity/product/ProductTest.php diff --git a/src/entity/image/UrlImage.php b/src/entity/image/UrlImage.php new file mode 100644 index 0000000..95f8d3e --- /dev/null +++ b/src/entity/image/UrlImage.php @@ -0,0 +1,21 @@ +product = new Product(); + $this->price = new Price(); + $this->image = new UrlImage(); + $this->product->setImage($this->image); + $this->product->setPrice($this->price); + $this->product->setColor(self::COLOR); + $this->product->setId(self::ID); + $this->product->setName(self::NAME); + } + + public function testImage():void{ + $this->assertInstanceOf(UrlImage::class, $this->product->getImage()); + } + + public function testPrice():void{ + $this->assertInstanceOf(Price::class, $this->product->getPrice()); + } + + public function testColor():void{ + $this->assertEquals(self::COLOR, $this->product->getColor()); + } + + public function testId():void{ + $this->assertEquals(self::ID, $this->product->getId()); + } + + public function testName():void{ + $this->assertEquals(self::NAME, $this->product->getColor()); + } +} + diff --git a/src/entity/user/UserInterface.php b/src/entity/user/UserInterface.php index 739b58c..de2b892 100644 --- a/src/entity/user/UserInterface.php +++ b/src/entity/user/UserInterface.php @@ -40,10 +40,5 @@ interface UserInterface * @return string */ public function getEmail():string; - - /** - * @return int - */ - public function getId():int; }