mirror of
https://github.com/kevin-DL/LaravelShoppingcart.git
synced 2026-01-11 18:54:33 +00:00
Add priceTotal to CartItemTest
This commit is contained in:
@@ -55,4 +55,13 @@ class CartItemTest extends TestCase
|
|||||||
|
|
||||||
$this->assertEquals($json, $cartItem->toJson());
|
$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());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user