Changeset View
Changeset View
Standalone View
Standalone View
src/tests/Feature/Controller/Admin/WalletsTest.php
Show First 20 Lines • Show All 70 Lines • ▼ Show 20 Lines | class WalletsTest extends TestCase | ||||
* Test awarding/penalizing a wallet (POST /api/v4/wallets/:id/one-off) | * Test awarding/penalizing a wallet (POST /api/v4/wallets/:id/one-off) | ||||
*/ | */ | ||||
public function testOneOff(): void | public function testOneOff(): void | ||||
{ | { | ||||
$user = $this->getTestUser('john@kolab.org'); | $user = $this->getTestUser('john@kolab.org'); | ||||
$admin = $this->getTestUser('jeroen@jeroen.jeroen'); | $admin = $this->getTestUser('jeroen@jeroen.jeroen'); | ||||
$wallet = $user->wallets()->first(); | $wallet = $user->wallets()->first(); | ||||
$balance = $wallet->balance; | $balance = $wallet->balance; | ||||
$reseller = $this->getTestUser('reseller@kolabnow.com'); | $reseller = $this->getTestUser('reseller@' . \config('app.domain')); | ||||
$wallet = $user->wallets()->first(); | $wallet = $user->wallets()->first(); | ||||
$reseller_wallet = $reseller->wallets()->first(); | $reseller_wallet = $reseller->wallets()->first(); | ||||
$reseller_balance = $reseller_wallet->balance; | $reseller_balance = $reseller_wallet->balance; | ||||
Transaction::where('object_id', $wallet->id) | Transaction::where('object_id', $wallet->id) | ||||
->whereIn('type', [Transaction::WALLET_AWARD, Transaction::WALLET_PENALTY]) | ->whereIn('type', [Transaction::WALLET_AWARD, Transaction::WALLET_PENALTY]) | ||||
->delete(); | ->delete(); | ||||
▲ Show 20 Lines • Show All 147 Lines • Show Last 20 Lines |