/** * @param string $discountCode * * @dataProvider couponCodeProvider */ public function testGettingCouponItem($discountCode) { $couponItem = new MandatoryItem(); $couponItem->setProductType(ProductType::DISCOUNT())->setName($discountCode); $propertyBookingInfo = new PropertyBookingInfo(); $propertyBookingInfo->setMandatoryItems([$couponItem]); $this->assertEquals($couponItem, $propertyBookingInfo->getCouponItem($discountCode)); }
/** * @return Price */ public function getPrice() { /** @var Price $price */ $price = clone $this->Price; if (ProductType::DISCOUNT() == $this->getProductType()) { $price->setPrice(-$price->getPrice()); } return $price; }
/** * @param string $productType * @param string $expectedBookingItemType * * @dataProvider productTypesProvider */ public function testConversionToBookingItemType($productType, $expectedBookingItemType) { $productType = new ProductType($productType); $this->assertEquals($expectedBookingItemType, $productType->toBookingItemType()); }
/** * @return bool */ public function isInsurance() { return $this->getProductType() == ProductType::INSURANCE(); }