public function testSetProductReplacement()
 {
     $product = new QuoteProduct();
     $this->assertNull($product->getProductSku());
     $product->setProductReplacement((new Product())->setSku('test-sku-replacement'));
     $this->assertEquals('test-sku-replacement', $product->getProductReplacementSku());
 }
 /**
  * @param array $offers
  * @param array $productParams
  * @param array $suggestedProductParams
  * @return QuoteProduct
  */
 protected function createQuoteProduct(array $offers, array $productParams = [], array $suggestedProductParams = [])
 {
     $quoteProduct = new QuoteProduct();
     foreach ($offers as $offer) {
         $quoteProduct->addQuoteProductOffer($offer);
     }
     if ($productParams) {
         $product = new Product();
         $product->addUnitPrecision($this->createPrecision($productParams));
         $quoteProduct->setProduct($product);
     }
     if ($suggestedProductParams) {
         $suggestedProduct = new Product();
         $suggestedProduct->addUnitPrecision($this->createPrecision($suggestedProductParams));
         $quoteProduct->setProductReplacement($suggestedProduct);
     }
     return $quoteProduct;
 }
 /**
  * @param string $sku
  * @param bool $isReplacement
  * @return QuoteProduct
  */
 protected function createQuoteProduct($sku, $isReplacement = false)
 {
     $product = new Product();
     $product->setSku($sku);
     $quoteProduct = new QuoteProduct();
     if ($isReplacement) {
         $quoteProduct->setProductReplacement($product);
     } else {
         $quoteProduct->setProduct($product);
     }
     return $quoteProduct;
 }