Changeset View
Changeset View
Standalone View
Standalone View
src/tests/Feature/Controller/Reseller/DiscountsTest.php
Show All 35 Lines | class DiscountsTest extends TestCase | ||||
/** | /** | ||||
* Test listing discounts (/api/v4/discounts) | * Test listing discounts (/api/v4/discounts) | ||||
*/ | */ | ||||
public function testIndex(): void | public function testIndex(): 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'); | ||||
$reseller = $this->getTestUser('reseller@reseller.com'); | $reseller = $this->getTestUser('reseller@sample-tenant.dev-local'); | ||||
$reseller2 = $this->getTestUser('reseller@kolabnow.com'); | $reseller2 = $this->getTestUser('reseller@' . \config('app.domain')); | ||||
$tenant = Tenant::where('title', 'Sample Tenant')->first(); | $tenant = Tenant::where('title', 'Sample Tenant')->first(); | ||||
\config(['app.tenant_id' => $tenant->id]); | \config(['app.tenant_id' => $tenant->id]); | ||||
// Non-admin user | // Non-admin user | ||||
$response = $this->actingAs($user)->get("api/v4/discounts"); | $response = $this->actingAs($user)->get("api/v4/discounts"); | ||||
$response->assertStatus(403); | $response->assertStatus(403); | ||||
▲ Show 20 Lines • Show All 54 Lines • Show Last 20 Lines |