Skip to content

Commit 46e0d2a

Browse files
committed
add test-unit's
1 parent ea56795 commit 46e0d2a

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

tests/WalletTest.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
use Bavix\Wallet\Exceptions\AmountInvalid;
66
use Bavix\Wallet\Exceptions\BalanceIsEmpty;
77
use Bavix\Wallet\Exceptions\InsufficientFunds;
8+
use Bavix\Wallet\Models\Transaction;
89
use Bavix\Wallet\Test\Models\User;
910

1011
class WalletTest extends TestCase
@@ -31,6 +32,22 @@ public function testDeposit(): void
3132

3233
$user->withdraw($user->balance);
3334
$this->assertEquals($user->balance, 0);
35+
36+
$this->assertEquals(
37+
$user->transactions()
38+
->where(['type' => Transaction::TYPE_DEPOSIT])
39+
->count(),
40+
3
41+
);
42+
43+
$this->assertEquals(
44+
$user->transactions()
45+
->where(['type' => Transaction::TYPE_WITHDRAW])
46+
->count(),
47+
1
48+
);
49+
50+
$this->assertEquals($user->transactions()->count(), 4);
3451
}
3552

3653
/**

0 commit comments

Comments
 (0)