Skip to content

Commit 41bf551

Browse files
author
Babichev Maxim
committed
add unit
1 parent 32a3cae commit 41bf551

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

tests/ConfirmTest.php

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,26 @@ public function testSafe(): void
5454
$this->assertFalse($transaction->confirmed);
5555
}
5656

57+
/**
58+
* @see https://github.com/bavix/laravel-wallet/issues/134
59+
* @return void
60+
*/
61+
public function testWithdraw(): void
62+
{
63+
/**
64+
* @var Buyer $buyer
65+
*/
66+
$buyer = factory(Buyer::class)->create();
67+
$wallet = $buyer->wallet;
68+
$wallet->deposit(100);
69+
70+
$this->assertEquals($wallet->balance, 100);
71+
72+
$transaction = $wallet->withdraw(50, ['desc' => 'unconfirmed'], false);
73+
$this->assertEquals($wallet->balance, 100);
74+
$this->assertFalse($transaction->confirmed);
75+
}
76+
5777
/**
5878
* @return void
5979
*/

0 commit comments

Comments
 (0)