From bd7a2ce807dbde0ca799f15c8e961b385fe5723e Mon Sep 17 00:00:00 2001 From: Rob Gloudemans Date: Thu, 19 May 2016 15:21:13 +0200 Subject: [PATCH] Added test to confirm bugfix in 5af3e902280a31a54f2fc1ebf3fcd84576299372 --- tests/CartTest.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tests/CartTest.php b/tests/CartTest.php index 8d624e0..7edc9d9 100644 --- a/tests/CartTest.php +++ b/tests/CartTest.php @@ -246,6 +246,21 @@ class CartTest extends Orchestra\Testbench\TestCase $this->assertRowsInCart(1, $cart); } + /** @test */ + public function it_will_keep_updating_the_quantity_when_an_item_is_added_multiple_times() + { + $cart = $this->getCart(); + + $item = $this->getBuyableMock(); + + $cart->add($item); + $cart->add($item); + $cart->add($item); + + $this->assertItemsInCart(3, $cart); + $this->assertRowsInCart(1, $cart); + } + /** @test */ public function it_can_update_the_quantity_of_an_existing_item_in_the_cart() {