$i3->setTotalFrom(150); $i3->setTotalTo(250); $i3->setReductionType('dollarOff'); $i3->setReductionValue(10); $i3->setMode('Group'); $i3->setCount(100); $i3->save(); $i4 = new rtShopPromotionCart(); $i4->setTitle('Voucher'); $i4->setCode($code2); $i4->setDateFrom(date('Y-m-d H:i:s', strtotime(sprintf("-%s months", 3)))); $i4->setDateTo(date('Y-m-d H:i:s', strtotime(sprintf("+%s months", 1)))); $i4->setTotalTo(150); $i4->setReductionType('percentageOff'); $i4->setReductionValue(15); $i4->setMode('Single'); $i4->setCount(1); $i4->save(); $t->pass('->save() on a rtShopPromotionCart object works'); } catch (Exception $e) { $t->fail('->save() on a rtShopPromotionCart failed!'); } $o1 = Doctrine::getTable('rtShopPromotionCart')->find($i3->getId()); $t->isa_ok($o1, 'rtShopPromotionCart', '->retrieve() rtShopPromotionCart object was saved to database and retrieved successfully'); $o2 = Doctrine::getTable('rtShopPromotionCart')->findAvailable(70, NULL); $t->is(count($o2), 1, '::findAvailable() retrieved 1 object successfully'); // Clean up $i3->delete(); $i4->delete(); unset($o1, $o2); /**