File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change 55namespace Bavix \Wallet \Test \Units \Domain ;
66
77use Bavix \Wallet \Test \Infra \Factories \BuyerFactory ;
8+ use Bavix \Wallet \Test \Infra \Factories \UserMultiFactory ;
89use Bavix \Wallet \Test \Infra \Models \Buyer ;
10+ use Bavix \Wallet \Test \Infra \Models \UserMulti ;
911use Bavix \Wallet \Test \Infra \TestCase ;
1012use Illuminate \Database \Eloquent \Collection ;
1113
@@ -54,4 +56,23 @@ public function testTransferTransactions(): void
5456 self ::assertTrue ($ transfer ->relationLoaded ('withdraw ' ));
5557 self ::assertTrue ($ transfer ->relationLoaded ('deposit ' ));
5658 }
59+
60+ public function testMultiWallets (): void
61+ {
62+ /** @var UserMulti $multi */
63+ $ multi = UserMultiFactory::new ()->create ();
64+ $ multi ->createWallet ([
65+ 'name ' => 'Hello ' ,
66+ ]);
67+
68+ $ multi ->createWallet ([
69+ 'name ' => 'World ' ,
70+ ]);
71+
72+ /** @var UserMulti $user */
73+ $ user = UserMulti::with ('wallets ' )->find ($ multi ->getKey ());
74+ self ::assertTrue ($ user ->relationLoaded ('wallets ' ));
75+ self ::assertNotNull ($ user ->getWallet ('hello ' ));
76+ self ::assertNotNull ($ user ->getWallet ('world ' ));
77+ }
5778}
You can’t perform that action at this time.
0 commit comments