public function testOnDuplicateAfterSourceProductWithoutPrices()
 {
     $this->productPriceRepository->expects($this->once())->method('getPricesByProduct')->with($this->sourceProduct)->will($this->returnValue([]));
     $this->objectManager->expects($this->never())->method('persist');
     $event = new ProductDuplicateAfterEvent($this->product, $this->sourceProduct);
     $this->listener->onDuplicateAfter($event);
 }
 public function testOnPostSubmitExistingProduct()
 {
     $product = $this->createProduct(1);
     $event = $this->createEvent($product);
     $priceOne = $this->createProductPrice(1);
     $priceTwo = $this->createProductPrice(2);
     $removedPrice = $this->createProductPrice(3);
     $this->assertPriceAdd($event, [$priceOne, $priceTwo]);
     $this->priceRepository->expects($this->once())->method('getPricesByProduct')->will($this->returnValue([$removedPrice]));
     $this->priceManager->expects($this->once())->method('remove')->with($removedPrice);
     $this->extension->onPostSubmit($event);
     $this->assertEquals($product, $priceOne->getProduct());
     $this->assertEquals($product, $priceTwo->getProduct());
 }