Skip to content

Commit efd351a

Browse files
committed
#469 add test
1 parent ec38517 commit efd351a

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

tests/Units/Domain/WalletFloatTest.php

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,29 @@ public function testBitcoin(): void
304304
self::assertSame('256.00000256000000000000000000000001', $user->balanceFloat);
305305
}
306306

307+
/**
308+
* Case from @EdX9.
309+
*
310+
* @see https://github.com/bavix/laravel-wallet/issues/469
311+
*
312+
* @throws ExceptionInterface
313+
*/
314+
public function testBigFloat(): void
315+
{
316+
/** @var User[] $users */
317+
$users = UserFloatFactory::times(2)->create();
318+
319+
[$first, $second] = $users;
320+
321+
self::assertSame(0, $first->balanceInt);
322+
self::assertSame(0, $second->balanceInt);
323+
324+
$first->forceTransferFloat($second, 6629944401);
325+
326+
self::assertSame(-662994440100, $first->balanceInt);
327+
self::assertSame(662994440100, $second->balanceInt);
328+
}
329+
307330
/**
308331
* Case from @ucanbehack.
309332
*

0 commit comments

Comments
 (0)