protected function preBuild()
 {
     $this->entityDTO->code = $this->entity->getCode();
     $this->entityDTO->flagFreeShipping = $this->entity->getFlagFreeShipping();
     $this->entityDTO->minOrderValue = $this->entity->getMinOrderValue();
     $this->entityDTO->maxOrderValue = $this->entity->getMaxOrderValue();
     $this->entityDTO->canCombineWithOtherCoupons = $this->entity->getCanCombineWithOtherCoupons();
 }
Example #2
0
 public function testCreate()
 {
     $code = '20PCT100';
     $coupon = new Coupon($code);
     $this->assertSame(null, $coupon->getName());
     $this->assertSame($code, $coupon->getCode());
     $this->assertSame(null, $coupon->getValue());
     $this->assertSame(null, $coupon->getMinOrderValue());
     $this->assertSame(null, $coupon->getMaxOrderValue());
     $this->assertTrue($coupon->getType()->isFixed());
     $this->assertFalse($coupon->getFlagFreeShipping());
     $this->assertFalse($coupon->getCanCombineWithOtherCoupons());
 }