Skip to content

Commit

Permalink
Merge pull request #859 from bavix/check-bind-units
Browse files Browse the repository at this point in the history
add a check for passing the correct model
  • Loading branch information
rez1dent3 authored Jan 23, 2024
2 parents fff328f + 8dafccc commit 5f30995
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/Units/Domain/DiscountTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
use Bavix\Wallet\Test\Infra\Models\Buyer;
use Bavix\Wallet\Test\Infra\Models\ItemDiscount;
use Bavix\Wallet\Test\Infra\TestCase;
use Bavix\Wallet\Test\Infra\PackageModels\Transaction as InfraTransaction;
use Bavix\Wallet\Test\Infra\PackageModels\Wallet as InfraWallet;

/**
* @internal
Expand Down Expand Up @@ -239,7 +241,11 @@ public function testPayFree(): void

$transfer = $buyer->payFree($product);
self::assertSame(Transaction::TYPE_DEPOSIT, $transfer->deposit->type);
self::assertInstanceOf(InfraTransaction::class, $transfer->deposit);
self::assertInstanceOf(InfraWallet::class, $transfer->from);
self::assertSame(Transaction::TYPE_WITHDRAW, $transfer->withdraw->type);
self::assertInstanceOf(InfraTransaction::class, $transfer->withdraw);
self::assertInstanceOf(InfraWallet::class, $transfer->to);

self::assertSame(0, $buyer->balanceInt);
self::assertSame(0, $product->balanceInt);
Expand Down

0 comments on commit 5f30995

Please sign in to comment.