test: add withCoupon test and fix withItems ID collision

This commit is contained in:
Joel Male
2026-05-27 21:33:35 +10:00
parent 61863e0bd5
commit 8d04d18b48
2 changed files with 16 additions and 1 deletions
+2 -1
View File
@@ -14,7 +14,8 @@ public function __construct(private Cart $cart) {}
public function withItems(int $count): static
{
for ($i = 1; $i <= $count; $i++) {
$start = $this->cart->getContent()->count() + 1;
for ($i = $start; $i < $start + $count; $i++) {
$this->cart->add($i, "Test Item {$i}", 10.00, 1);
}