Changeset View
Changeset View
Standalone View
Standalone View
src/tests/Feature/Controller/Admin/WalletsTest.php
Show First 20 Lines • Show All 127 Lines • ▼ Show 20 Lines | public function testOneOff(): void | ||||
$this->assertSame('The penalty has been added to the wallet successfully.', $json['message']); | $this->assertSame('The penalty has been added to the wallet successfully.', $json['message']); | ||||
$this->assertSame($balance -= 4000, $json['balance']); | $this->assertSame($balance -= 4000, $json['balance']); | ||||
$this->assertSame($balance, $wallet->fresh()->balance); | $this->assertSame($balance, $wallet->fresh()->balance); | ||||
$transaction = Transaction::where('object_id', $wallet->id) | $transaction = Transaction::where('object_id', $wallet->id) | ||||
->where('type', Transaction::WALLET_PENALTY)->first(); | ->where('type', Transaction::WALLET_PENALTY)->first(); | ||||
$this->assertSame($post['description'], $transaction->description); | $this->assertSame($post['description'], $transaction->description); | ||||
$this->assertSame(4000, $transaction->amount); | $this->assertSame(-4000, $transaction->amount); | ||||
$this->assertSame($admin->email, $transaction->user_email); | $this->assertSame($admin->email, $transaction->user_email); | ||||
} | } | ||||
/** | /** | ||||
* Test fetching wallet transactions (GET /api/v4/wallets/:id/transactions) | * Test fetching wallet transactions (GET /api/v4/wallets/:id/transactions) | ||||
*/ | */ | ||||
public function testTransactions(): void | public function testTransactions(): void | ||||
{ | { | ||||
▲ Show 20 Lines • Show All 84 Lines • Show Last 20 Lines |