Skip to content

Commit

Permalink
fixing a test
Browse files Browse the repository at this point in the history
  • Loading branch information
wernerkrauss committed Feb 26, 2024
1 parent 74428a2 commit 0acfeaf
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/OrderCouponTest.php
Expand Up @@ -73,7 +73,7 @@ public function testPercent()
);
$coupon->write();
$context = ['CouponCode' => $coupon->Code];
$this->assertTrue($coupon->validateOrder($this->cart, $context), $coupon->getMessage());
$this->assertTrue($coupon->validateOrder($this->cart, $context), (string)$coupon->getMessage());
$this->assertEquals(4, $coupon->getDiscountValue(10), '40% off value');
$this->assertEquals(200, $this->calc($this->unpaid, $coupon), '40% off order');
}
Expand All @@ -92,9 +92,9 @@ public function testAmount()
$coupon->write();

$context = ['CouponCode' => $coupon->Code];
$this->assertTrue($coupon->validateOrder($this->cart, $context), $coupon->getMessage());
$this->assertTrue($coupon->validateOrder($this->cart, $context), (string)$coupon->getMessage());
$this->assertEquals($coupon->getDiscountValue(1000), 10, '$10 off fixed value');
$this->assertTrue($coupon->validateOrder($this->unpaid, $context), $coupon->getMessage());
$this->assertTrue($coupon->validateOrder($this->unpaid, $context), (string)$coupon->getMessage());
$this->assertEquals(60, $this->calc($this->unpaid, $coupon), '$10 off each item: $60 total');
//TODO: test amount that is greater than item value
}
Expand Down

0 comments on commit 0acfeaf

Please sign in to comment.