Initial commit
This commit is contained in:
23
tests/Unit/Models/WalletTransactionTest.php
Normal file
23
tests/Unit/Models/WalletTransactionTest.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use App\Models\WalletTransaction;
|
||||
|
||||
test('that transfers transactions are correctly identified as transfers', function () {
|
||||
$transaction = WalletTransaction::factory()
|
||||
->credit()
|
||||
->amount(100)
|
||||
->make(['transfer_id' => 1]);
|
||||
|
||||
expect($transaction->is_transfer)->toBeTrue();
|
||||
});
|
||||
|
||||
test('that classic transactions aren\'t identified as transfers', function () {
|
||||
$transaction = WalletTransaction::factory()
|
||||
->credit()
|
||||
->amount(100)
|
||||
->make();
|
||||
|
||||
expect($transaction->is_transfer)->toBeFalse();
|
||||
});
|
Reference in New Issue
Block a user