Exemple #1
0
 /**
  * @param ProductWasAddedToBasket $event
  */
 private function whenProductWasAddedToBasket(ProductWasAddedToBasket $event)
 {
     $productId = $event->productId()->toString();
     if (!isset($this->products[$productId])) {
         $this->products[$productId] = 0;
     }
     $this->products[$productId]++;
     $this->productCount++;
 }
 /**
  * @test
  */
 public function itExposesAProductId()
 {
     $productId = ProductId::fromString('product-1');
     $this->assertTrue($productId->equals($this->event->productId()));
 }