コード例 #1
0
 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);
 }
コード例 #2
0
 /**
  * @return static
  */
 public function withPrice(PricingInterface $pricing)
 {
     $this->entityDTO->price = $this->dtoBuilderFactory->getPriceDTOBuilder($this->entity->getPrice($pricing))->withAllData()->build();
     return $this;
 }