Changeset View
Changeset View
Standalone View
Standalone View
src/tests/Unit/TransactionTest.php
Show First 20 Lines • Show All 46 Lines • ▼ Show 20 Lines | public function testLabels(): void | ||||
$transaction = Transaction::create([ | $transaction = Transaction::create([ | ||||
'object_id' => $wallet->id, | 'object_id' => $wallet->id, | ||||
'object_type' => Wallet::class, | 'object_type' => Wallet::class, | ||||
'type' => Transaction::WALLET_AWARD, | 'type' => Transaction::WALLET_AWARD, | ||||
'amount' => 12, | 'amount' => 12, | ||||
'description' => "A test award" | 'description' => "A test award" | ||||
]); | ]); | ||||
$sku = Sku::where('title', 'mailbox')->first(); | $sku = Sku::withEnvTenantContext()->where('title', 'mailbox')->first(); | ||||
$entitlement = Entitlement::where('sku_id', $sku->id)->first(); | $entitlement = Entitlement::where('sku_id', $sku->id)->first(); | ||||
$transaction = Transaction::create([ | $transaction = Transaction::create([ | ||||
'user_email' => 'test@test.com', | 'user_email' => 'test@test.com', | ||||
'object_id' => $entitlement->id, | 'object_id' => $entitlement->id, | ||||
'object_type' => Entitlement::class, | 'object_type' => Entitlement::class, | ||||
'type' => Transaction::ENTITLEMENT_CREATED, | 'type' => Transaction::ENTITLEMENT_CREATED, | ||||
'amount' => 13 | 'amount' => 13 | ||||
]); | ]); | ||||
$sku = Sku::where('title', 'domain-hosting')->first(); | $sku = Sku::withEnvTenantContext()->where('title', 'domain-hosting')->first(); | ||||
$entitlement = Entitlement::where('sku_id', $sku->id)->first(); | $entitlement = Entitlement::where('sku_id', $sku->id)->first(); | ||||
$transaction = Transaction::create([ | $transaction = Transaction::create([ | ||||
'user_email' => 'test@test.com', | 'user_email' => 'test@test.com', | ||||
'object_id' => $entitlement->id, | 'object_id' => $entitlement->id, | ||||
'object_type' => Entitlement::class, | 'object_type' => Entitlement::class, | ||||
'type' => Transaction::ENTITLEMENT_BILLED, | 'type' => Transaction::ENTITLEMENT_BILLED, | ||||
'amount' => 14 | 'amount' => 14 | ||||
]); | ]); | ||||
$sku = Sku::where('title', 'storage')->first(); | $sku = Sku::withEnvTenantContext()->where('title', 'storage')->first(); | ||||
$entitlement = Entitlement::where('sku_id', $sku->id)->first(); | $entitlement = Entitlement::where('sku_id', $sku->id)->first(); | ||||
$transaction = Transaction::create([ | $transaction = Transaction::create([ | ||||
'user_email' => 'test@test.com', | 'user_email' => 'test@test.com', | ||||
'object_id' => $entitlement->id, | 'object_id' => $entitlement->id, | ||||
'object_type' => Entitlement::class, | 'object_type' => Entitlement::class, | ||||
'type' => Transaction::ENTITLEMENT_DELETED, | 'type' => Transaction::ENTITLEMENT_DELETED, | ||||
'amount' => 15 | 'amount' => 15 | ||||
]); | ]); | ||||
▲ Show 20 Lines • Show All 122 Lines • Show Last 20 Lines |