File tree Expand file tree Collapse file tree 2 files changed +20
-1
lines changed Expand file tree Collapse file tree 2 files changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -317,7 +317,7 @@ public function forceTransferFloat(
317317 public function getBalanceFloatAttribute (): string
318318 {
319319 // Get the wallet.
320- $ wallet = app (CastServiceInterface::class)->getWallet ($ this );
320+ $ wallet = app (CastServiceInterface::class)->getWallet ($ this , false );
321321
322322 // Get the wallet balance.
323323 /** @var non-empty-string $balance */
Original file line number Diff line number Diff line change 1919 */
2020final class BalanceTest extends TestCase
2121{
22+ public function testBalanceWalletNotExists ()
23+ {
24+ /** @var Buyer $buyer */
25+ $ buyer = BuyerFactory::new ()->create ();
26+ self ::assertFalse ($ buyer ->relationLoaded ('wallet ' ));
27+
28+ self ::assertSame (0 , (int ) $ buyer ->wallet ->balance );
29+ self ::assertFalse ($ buyer ->wallet ->exists );
30+
31+ self ::assertSame (0 , $ buyer ->wallet ->balanceInt );
32+ self ::assertFalse ($ buyer ->wallet ->exists );
33+
34+ self ::assertSame (0. , (float )$ buyer ->wallet ->balanceFloat );
35+ self ::assertFalse ($ buyer ->wallet ->exists );
36+
37+ self ::assertSame (0. , $ buyer ->wallet ->balanceFloatNum );
38+ self ::assertFalse ($ buyer ->wallet ->exists );
39+ }
40+
2241 public function testDepositWalletExists (): void
2342 {
2443 /** @var Buyer $buyer */
You can’t perform that action at this time.
0 commit comments