Update CartItemTest.php

This commit is contained in:
Patrick
2022-02-05 19:12:10 +01:00
committed by GitHub
parent 9f9df6a8f0
commit 98ce5be39a

View File

@@ -25,8 +25,7 @@ class CartItemTest extends TestCase
/** @test */ /** @test */
public function it_can_be_cast_to_an_array() public function it_can_be_cast_to_an_array()
{ {
$cartItem = new CartItem(1, 'Some item', new Money(10.00, new Currency('USD')), 550, ['size' => 'XL', 'color' => 'red']); $cartItem = new CartItem(1, 'Some item', new Money(10.00, new Currency('USD')), 550, 2, ['size' => 'XL', 'color' => 'red']);
$cartItem->setQuantity(2);
$this->assertEquals([ $this->assertEquals([
'id' => 1, 'id' => 1,
@@ -48,8 +47,7 @@ class CartItemTest extends TestCase
/** @test */ /** @test */
public function it_can_be_cast_to_json() public function it_can_be_cast_to_json()
{ {
$cartItem = new CartItem(1, 'Some item', new Money(10.00, new Currency('USD')), 550, ['size' => 'XL', 'color' => 'red']); $cartItem = new CartItem(1, 'Some item', new Money(10.00, new Currency('USD')), 550, 2, ['size' => 'XL', 'color' => 'red']);
$cartItem->setQuantity(2);
$this->assertJson($cartItem->toJson()); $this->assertJson($cartItem->toJson());