/**
  * @param Merchant $merchant
  *
  * @return Merchant
  */
 public function addMerchant(Merchant $merchant)
 {
     if (!isset($this->merchants[$merchant->name()])) {
         $this->merchants[$merchant->name()] = $merchant;
     }
     return $this->merchants[$merchant->name()];
 }
 /**
  * @return array
  */
 private function buildFindAllMerchantRepositoryResponse()
 {
     $merchant1 = new Merchant('Joyeria Baguette', 'Address');
     $merchant1->addProduct(FakeProductBuilder::buildProductForMerchant($merchant1))->addProduct(FakeProductBuilder::buildProductForMerchant($merchant1));
     $merchant2 = new Merchant('Deportes PlacĂ­dia', 'Address2');
     $merchant2->addProduct(FakeProductBuilder::buildProductForMerchant($merchant2));
     return [$merchant1, $merchant2];
 }
 /**
  * @test
  */
 public function itShouldHasUuidIdentifier()
 {
     $merchant = new Merchant('Joyeria Baguette', 'Address');
     Assertion::uuid($merchant->id());
 }
 /**
  * @param Merchant $merchant
  *
  * @return array
  */
 private function merchantExists(Merchant $merchant)
 {
     return $this->findBy(['name' => $merchant->name()]);
 }