public function testCreate()
 {
     $pricing = $this->dummyData->getPricing();
     $this->productQuantityDiscount->setCustomerGroup(null);
     $this->productQuantityDiscount->setQuantity(6);
     $this->productQuantityDiscount->setFlagApplyCatalogPromotions(true);
     $this->assertEntityValid($this->productQuantityDiscount);
     $this->assertSame(null, $this->productQuantityDiscount->getCustomerGroup());
     $this->assertSame(6, $this->productQuantityDiscount->getQuantity());
     $this->assertSame(true, $this->productQuantityDiscount->getFlagApplyCatalogPromotions());
     $this->assertSame($this->product, $this->productQuantityDiscount->getProduct());
     $this->assertTrue($this->productQuantityDiscount->getPrice($pricing) instanceof Price);
 }
Exemple #2
0
 public function getProductQuantityDiscount(Product $product = null)
 {
     if ($product === null) {
         $product = $this->getProduct();
     }
     $productQuantityDiscount = new ProductQuantityDiscount($product);
     $productQuantityDiscount->setType(PromotionType::percent());
     $productQuantityDiscount->setQuantity(6);
     $productQuantityDiscount->setValue(5);
     $productQuantityDiscount->setCustomerGroup(null);
     $productQuantityDiscount->setQuantity(1);
     $productQuantityDiscount->setFlagApplyCatalogPromotions(true);
     return $productQuantityDiscount;
 }