From 57d73f32b31923d1e0f110db8fcbb56e86014f71 Mon Sep 17 00:00:00 2001 From: Patrick Henninger Date: Sat, 29 Aug 2020 16:28:28 +0200 Subject: [PATCH] Add priceTotal to CartItemTest --- tests/CartItemTest.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/CartItemTest.php b/tests/CartItemTest.php index 063ec18..04ddf19 100644 --- a/tests/CartItemTest.php +++ b/tests/CartItemTest.php @@ -55,4 +55,13 @@ class CartItemTest extends TestCase $this->assertEquals($json, $cartItem->toJson()); } + + /** @test */ + public function it_formats_price_total_correctly() + { + $cartItem = new CartItem(1, 'Some item', 10.00, 550, ['size' => 'XL', 'color' => 'red']); + $cartItem->setQuantity(2); + + $this->assertSame('20.00', $cartItem->priceTotal()); + } }