mirror of
https://github.com/kevin-DL/LaravelShoppingcart.git
synced 2026-01-23 23:51:25 +00:00
Update CartTest.php
This commit is contained in:
@@ -1225,26 +1225,6 @@ class CartTest extends TestCase
|
|||||||
$this->assertEquals(new Money(1190, new Currency('USD')), $cartItem->total);
|
$this->assertEquals(new Money(1190, new Currency('USD')), $cartItem->total);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @test */
|
|
||||||
public function it_does_calculate_correct_results_with_rational_qtys()
|
|
||||||
{
|
|
||||||
// https://github.com/Crinsane/LaravelShoppingcart/issues/544
|
|
||||||
$cart = $this->getCart();
|
|
||||||
|
|
||||||
$cart->add(new BuyableProductTrait([
|
|
||||||
'name' => 'First item',
|
|
||||||
]), 0.5);
|
|
||||||
|
|
||||||
$cartItem = $cart->get('027c91341fd5cf4d2579b49c4b6a90da');
|
|
||||||
|
|
||||||
$cart->setGlobalTax(50);
|
|
||||||
|
|
||||||
$this->assertEquals(new Money(1000, new Currency('USD')), $cartItem->price);
|
|
||||||
$this->assertEquals(new Money(500, new Currency('USD')), $cart->subtotal()); //0.5 qty
|
|
||||||
$this->assertEquals(new Money(750, new Currency('USD')), $cart->total()); // plus tax
|
|
||||||
$this->assertEquals(new Money(250, new Currency('USD')), $cart->tax()); // tax of 5 Bucks
|
|
||||||
}
|
|
||||||
|
|
||||||
/** @test */
|
/** @test */
|
||||||
public function it_does_allow_adding_cart_items_with_weight_and_options()
|
public function it_does_allow_adding_cart_items_with_weight_and_options()
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user