mirror of
https://github.com/wearepixel/laravel-cart.git
synced 2026-11-14 13:51:44 +00:00
test: add withCoupon test and fix withItems ID collision
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user