Skip to content

Commit 8dafccc

Browse files
committed
add a check for passing the correct model
1 parent fff328f commit 8dafccc

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

tests/Units/Domain/DiscountTest.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
use Bavix\Wallet\Test\Infra\Models\Buyer;
1515
use Bavix\Wallet\Test\Infra\Models\ItemDiscount;
1616
use Bavix\Wallet\Test\Infra\TestCase;
17+
use Bavix\Wallet\Test\Infra\PackageModels\Transaction as InfraTransaction;
18+
use Bavix\Wallet\Test\Infra\PackageModels\Wallet as InfraWallet;
1719

1820
/**
1921
* @internal
@@ -239,7 +241,11 @@ public function testPayFree(): void
239241

240242
$transfer = $buyer->payFree($product);
241243
self::assertSame(Transaction::TYPE_DEPOSIT, $transfer->deposit->type);
244+
self::assertInstanceOf(InfraTransaction::class, $transfer->deposit);
245+
self::assertInstanceOf(InfraWallet::class, $transfer->from);
242246
self::assertSame(Transaction::TYPE_WITHDRAW, $transfer->withdraw->type);
247+
self::assertInstanceOf(InfraTransaction::class, $transfer->withdraw);
248+
self::assertInstanceOf(InfraWallet::class, $transfer->to);
243249

244250
self::assertSame(0, $buyer->balanceInt);
245251
self::assertSame(0, $product->balanceInt);

0 commit comments

Comments
 (0)