Skip to content

Commit

Permalink
wallets.walletTransactions
Browse files Browse the repository at this point in the history
  • Loading branch information
rez1dent3 committed Aug 21, 2024
1 parent 7806d59 commit f499ff1
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions tests/Units/Domain/EagerLoadingTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public function testUuidDuplicate(): void
}

/** @var Collection<int, Buyer> $buyers */
$buyers = Buyer::with('wallet')
$buyers = Buyer::with('wallet.walletTransactions')
->whereIn('id', $buyerTimes->pluck('id')->toArray())
->paginate(10);

Expand All @@ -42,6 +42,7 @@ public function testUuidDuplicate(): void
foreach ($buyers as $buyer) {
self::assertTrue($buyer->relationLoaded('wallet'));
self::assertTrue($buyer->wallet->relationLoaded('holder'));
self::assertTrue($buyer->wallet->relationLoaded('walletTransactions'));

$uuids[] = $buyer->wallet->uuid;
$balances[] = $buyer->wallet->balanceInt;
Expand Down Expand Up @@ -85,8 +86,10 @@ public function testMultiWallets(): void
]);

/** @var UserMulti $user */
$user = UserMulti::with('wallets')->find($multi->getKey());
$user = UserMulti::with('wallets.walletTransactions')->find($multi->getKey());
self::assertTrue($user->relationLoaded('wallets'));
self::assertNotEmpty($user->wallets);
self::assertTrue($user->wallets[0]->relationLoaded('walletTransactions'));
self::assertNotNull($user->getWallet('hello'));
self::assertNotNull($user->getWallet('world'));
self::assertTrue($user->getWallet('hello')->relationLoaded('holder'));
Expand Down

0 comments on commit f499ff1

Please sign in to comment.