We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0f355e1 commit 913728fCopy full SHA for 913728f
tests/Units/Domain/CartTest.php
@@ -26,6 +26,29 @@
26
*/
27
final class CartTest extends TestCase
28
{
29
+ public function testCartClone(): void
30
+ {
31
+ /** @var ItemMeta $product */
32
+ $product = ItemMetaFactory::new()->create([
33
+ 'quantity' => 1,
34
+ ]);
35
+
36
+ $cart = app(Cart::class);
37
38
+ $cartWithItems = $cart->withItems([$product]);
39
+ $cartWithMeta = $cart->withMeta([
40
+ 'product_id' => $product->getKey(),
41
42
43
+ self::assertCount(0, $cart->getItems());
44
+ self::assertCount(1, $cartWithItems->getItems());
45
46
+ self::assertSame([], $cart->getMeta());
47
+ self::assertSame([
48
49
+ ], $cartWithMeta->getMeta());
50
+ }
51
52
public function testCartMeta(): void
53
54
/**
0 commit comments