/**
  * @return rtShopPromotion
  */
 public function getPromotion()
 {
     if (is_null($this->_promotion)) {
         $this->_promotion = rtShopPromotionToolkit::getBest($this->getSubTotal());
     }
     return $this->_promotion;
 }
    $i12 = new rtShopPromotionCart();
    $i12->setTitle('Combinations');
    $i12->setDateFrom(date('Y-m-d H:i:s', strtotime(sprintf("-%s months", 1))));
    $i12->setDateTo(date('Y-m-d H:i:s', strtotime(sprintf("+%s months", 3))));
    $i12->setTotalFrom(200);
    $i12->setTotalTo(300);
    $i12->setReductionType('dollarOff');
    $i12->setReductionValue(25);
    $i12->save();
    $t->pass('->save() on a rtShopPromotion object works');
} catch (Exception $e) {
    $t->fail('->save() on a rtShopPromotion failed!');
}
$t->diag('Get best promotion offer');
$order_total = 130;
$promotions = rtShopPromotionToolkit::getBest($order_total, date("Y-m-d H:i:s"));
$t->is(get_class($promotions), 'rtShopPromotionCart', '::getBest() Returns a rtShopPromotion object correctly.');
$t->is($promotions->getId(), $i8->getId(), '::getBest() Best offer found.');
$t->diag('Apply best promotion offer');
$promotion_total = rtShopPromotionToolkit::applyPromotion($order_total, date("Y-m-d H:i:s"));
$t->is($promotion_total, 30, '::applyPromotion() Applied best promotion correctly and returned new total.');
$t->diag('Get next best promotion offer');
$promotions = rtShopPromotionToolkit::getNextBest(130, date("Y-m-d H:i:s"));
$t->is(get_class($promotions), 'rtShopPromotionCart', '::getNextBest() Returns a rtShopPromotion object correctly.');
$t->is($promotions->getId(), $i11->getId(), '::getNextBest() Next best offer found.');
$t->diag('Get distance to next best promotion offer');
$order_total = 130;
$promotions = rtShopPromotionToolkit::getDistanceToNextBest($order_total, date("Y-m-d H:i:s"));
$t->is($promotions, $i11->getTotalFrom() - $order_total, '::getDistanceToNextBest() Distance to next best offer found.');
// Clean up
$i3->delete();