From 9785ebf5a2ba8df2f31c565ca3c125cd2a27404e Mon Sep 17 00:00:00 2001 From: Kevin Frantz Date: Sat, 14 Jul 2018 11:29:40 +0200 Subject: [PATCH] Implemented product --- src/entity/product/Product.php | 48 +++++++++++++++++++++++------- src/entity/product/ProductTest.php | 2 +- 2 files changed, 39 insertions(+), 11 deletions(-) diff --git a/src/entity/product/Product.php b/src/entity/product/Product.php index 9806adf..419fa1b 100644 --- a/src/entity/product/Product.php +++ b/src/entity/product/Product.php @@ -11,35 +11,63 @@ use entity\image\ImageInterface; */ final class Product implements ProductInterface { + private $name; + + private $image; + + private $color; + + private $price; + public function setName(string $name): void - {} + { + $this->name = $name; + } public function getName(): string - {} + { + return $this->name; + } public function setColor(string $color): void - {} + { + $this->color = $color; + } public function getColor(): string - {} + { + return $this->color; + } public function setId(int $id): void - {} + { + $this->id = $id; + } public function getId(): int - {} + { + return $this->id; + } public function setPrice(PriceInterface $price): void - {} + { + $this->price = $price; + } public function getImage(): ImageInterface - {} + { + return $this->image; + } public function getPrice(): PriceInterface - {} + { + return $this->price; + } public function setImage(ImageInterface $image): void - {} + { + $this->image = $image; + } } diff --git a/src/entity/product/ProductTest.php b/src/entity/product/ProductTest.php index 9585e9c..e77dda1 100644 --- a/src/entity/product/ProductTest.php +++ b/src/entity/product/ProductTest.php @@ -62,7 +62,7 @@ class ProductTest extends TestCase } public function testName():void{ - $this->assertEquals(self::NAME, $this->product->getColor()); + $this->assertEquals(self::NAME, $this->product->getName()); } }