Skip to content

Commit 0a46877

Browse files
committed
fix units
1 parent aec019a commit 0a46877

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/Internal/Dto/BasketDto.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,9 @@ public function total(): int
4040
public function cursor(): Generator
4141
{
4242
foreach ($this->items as $item) {
43-
yield from $item->getItems();
43+
foreach ($item->getItems() as $product) {
44+
yield $product;
45+
}
4446
}
4547
}
4648

tests/Units/Domain/CartTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ public function testModelNotFoundException(): void
233233

234234
self::assertCount($total, $cart->getItems());
235235
self::assertCount(count($products) - 1, $cart->getBasketDto()->items());
236-
self::assertCount($total, $cart->getBasketDto()->cursor());
236+
self::assertCount($total, iterator_to_array($cart->getBasketDto()->cursor()));
237237
self::assertSame($total, $cart->getBasketDto()->total());
238238

239239
$transfers = $buyer->payCart($cart);

0 commit comments

Comments
 (0)