Implemented product

This commit is contained in:
Kevin Frantz 2018-07-14 11:29:40 +02:00
parent a1c5fba3b1
commit 9785ebf5a2
2 changed files with 39 additions and 11 deletions

View File

@ -11,35 +11,63 @@ use entity\image\ImageInterface;
*/ */
final class Product implements ProductInterface final class Product implements ProductInterface
{ {
private $name;
private $image;
private $color;
private $price;
public function setName(string $name): void public function setName(string $name): void
{} {
$this->name = $name;
}
public function getName(): string public function getName(): string
{} {
return $this->name;
}
public function setColor(string $color): void public function setColor(string $color): void
{} {
$this->color = $color;
}
public function getColor(): string public function getColor(): string
{} {
return $this->color;
}
public function setId(int $id): void public function setId(int $id): void
{} {
$this->id = $id;
}
public function getId(): int public function getId(): int
{} {
return $this->id;
}
public function setPrice(PriceInterface $price): void public function setPrice(PriceInterface $price): void
{} {
$this->price = $price;
}
public function getImage(): ImageInterface public function getImage(): ImageInterface
{} {
return $this->image;
}
public function getPrice(): PriceInterface public function getPrice(): PriceInterface
{} {
return $this->price;
}
public function setImage(ImageInterface $image): void public function setImage(ImageInterface $image): void
{} {
$this->image = $image;
}
} }

View File

@ -62,7 +62,7 @@ class ProductTest extends TestCase
} }
public function testName():void{ public function testName():void{
$this->assertEquals(self::NAME, $this->product->getColor()); $this->assertEquals(self::NAME, $this->product->getName());
} }
} }