Changeset View
Changeset View
Standalone View
Standalone View
src/tests/Unit/TransactionTest.php
Show First 20 Lines • Show All 52 Lines • ▼ Show 20 Lines | public function testInvalidType() | ||||
[ | [ | ||||
'object_id' => $wallet->id, | 'object_id' => $wallet->id, | ||||
'object_type' => \App\Wallet::class, | 'object_type' => \App\Wallet::class, | ||||
'type' => 'invalid', | 'type' => 'invalid', | ||||
'amount' => 9 | 'amount' => 9 | ||||
] | ] | ||||
); | ); | ||||
} | } | ||||
public function testEntitlementForWallet(): void | |||||
{ | |||||
$transaction = \App\Transaction::where('object_type', \App\Wallet::class) | |||||
->whereIn('object_id', \App\Wallet::pluck('id'))->first(); | |||||
$entitlement = $transaction->entitlement(); | |||||
$this->assertNull($entitlement); | |||||
$this->assertNotNull($transaction->wallet()); | |||||
} | |||||
public function testWalletForEntitlement(): void | |||||
{ | |||||
$transaction = \App\Transaction::where('object_type', \App\Entitlement::class) | |||||
->whereIn('object_id', \App\Entitlement::pluck('id'))->first(); | |||||
$wallet = $transaction->wallet(); | |||||
$this->assertNull($wallet); | |||||
$this->assertNotNull($transaction->entitlement()); | |||||
} | |||||
} | } |