Skip to content

Commit f7664de

Browse files
committed
add case #149
1 parent 1762837 commit f7664de

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

tests/WalletFloatTest.php

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -347,4 +347,27 @@ public function testBitcoin(): void
347347
}
348348
}
349349

350+
/**
351+
* Case from @ucanbehack
352+
* @see https://github.com/bavix/laravel-wallet/issues/149
353+
*/
354+
public function testBitcoin2(): void
355+
{
356+
if (app(Mathable::class) instanceof BCMath) {
357+
/**
358+
* @var User $user
359+
*/
360+
$user = factory(User::class)->create();
361+
$this->assertEquals($user->balance, 0);
362+
363+
$user->wallet->decimal_places = 8;
364+
$user->wallet->save();
365+
366+
$user->depositFloat(0.09699977);
367+
368+
$this->assertEquals($user->balanceFloat, 0.09699977);
369+
$this->assertEquals($user->balance, 9699977);
370+
}
371+
}
372+
350373
}

0 commit comments

Comments
 (0)