You are here

public function UcCouponTestCase::testGiftCertificate in Ubercart Discount Coupons 7.3

File

tests/uc_coupon.test, line 106
Ubercart Discount Coupon Tests.

Class

UcCouponTestCase
SimpleTests for Ubercart Discount Coupons

Code

public function testGiftCertificate() {
  $coupon = $this
    ->createCoupon(array(
    'discount' => '100',
    'store_credit' => 1,
  ));
  $product = $this
    ->createProduct(array(
    'sell_price' => '75',
  ));
  $this
    ->applyCoupons(array(
    $coupon,
  ), array(
    $product,
  ), 0);
  $this
    ->assertText('Subtotal: $0.00');
  $order = $this
    ->checkout();
  uc_order_update_status($order->order_id, 'payment_received');
  $this
    ->applyCoupons(array(
    $coupon,
  ), array(
    $product,
  ), 50);
}