Skip to content

Commit 39d068b

Browse files
committed
fix test for mariadb
1 parent 2507fb7 commit 39d068b

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

tests/Units/Domain/EagerLoadingTest.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
namespace Bavix\Wallet\Test\Units\Domain;
66

7+
use Bavix\Wallet\Interfaces\ProductInterface;
78
use Bavix\Wallet\Objects\Cart;
89
use Bavix\Wallet\Test\Infra\Factories\BuyerFactory;
910
use Bavix\Wallet\Test\Infra\Factories\ItemFactory;
@@ -95,7 +96,7 @@ public function testEagerLoaderPay(): void
9596
$buyer = BuyerFactory::new()->create();
9697
/** @var Item[] $products */
9798
$products = ItemFactory::times(50)->create([
98-
'quantity' => 10,
99+
'quantity' => 5,
99100
'price' => 1,
100101
]);
101102
$productIds = [];
@@ -104,15 +105,16 @@ public function testEagerLoaderPay(): void
104105
self::assertSame(0, $product->balanceInt);
105106
}
106107

108+
/** @var ProductInterface[] $products */
107109
$products = Item::query()->whereKey($productIds)->get()->all();
108110

109111
$cart = app(Cart::class);
110112
foreach ($products as $product) {
111-
$cart = $cart->withItem($product, 10);
113+
$cart = $cart->withItem($product, 5);
112114
}
113115

114116
$transfers = $buyer->forcePayCart($cart);
115117
self::assertSame((int) -$cart->getTotal($buyer), $buyer->balanceInt);
116-
self::assertCount(500, $transfers);
118+
self::assertCount(250, $transfers);
117119
}
118120
}

0 commit comments

Comments
 (0)