Beispiel #1
0
 public function __construct(Product $product, Order $order, Quantity $quantity)
 {
     $this->product = $product;
     $this->order = $order;
     $this->quantity = $quantity;
     $this->price = $product->getPrice();
 }
Beispiel #2
0
 public function testConstruct()
 {
     $uuid = $this->getUuidMock();
     $name = 'test product';
     $price = new Money(10000);
     $category = new Category(new UuidIdentity('uuid2'), 'test cat');
     $description = 'description';
     $availability = true;
     $product = new Product($uuid, $name, $price, $category, $description, $availability, '/');
     $this->assertSame($uuid, $product->getId());
     $this->assertSame($name, $product->getName());
     $this->assertSame($price, $product->getPrice());
     $this->assertSame($category, $product->getCategory());
     $this->assertSame($description, $product->getDescription());
     $this->assertTrue($product->isAvailable());
 }