Changeset View
Changeset View
Standalone View
Standalone View
src/tests/Feature/Controller/Reseller/DomainsTest.php
Show First 20 Lines • Show All 179 Lines • ▼ Show 20 Lines | public function testStatus(): void | ||||
$domain = $this->getTestDomain('kolab.org'); | $domain = $this->getTestDomain('kolab.org'); | ||||
// This end-point does not exist for resellers | // This end-point does not exist for resellers | ||||
$response = $this->actingAs($reseller1)->get("/api/v4/domains/{$domain->id}/status"); | $response = $this->actingAs($reseller1)->get("/api/v4/domains/{$domain->id}/status"); | ||||
$response->assertStatus(404); | $response->assertStatus(404); | ||||
} | } | ||||
/** | /** | ||||
* Test creeating a domain (POST /api/v4/domains) | |||||
*/ | |||||
public function testStore(): void | |||||
{ | |||||
$reseller1 = $this->getTestUser('reseller@' . \config('app.domain')); | |||||
// Resellers can't create domains | |||||
$response = $this->actingAs($reseller1)->post("api/v4/domains", []); | |||||
$response->assertStatus(404); | |||||
} | |||||
/** | |||||
* Test domain suspending (POST /api/v4/domains/<domain-id>/suspend) | * Test domain suspending (POST /api/v4/domains/<domain-id>/suspend) | ||||
*/ | */ | ||||
public function testSuspend(): void | public function testSuspend(): void | ||||
{ | { | ||||
Queue::fake(); // disable jobs | Queue::fake(); // disable jobs | ||||
$admin = $this->getTestUser('jeroen@jeroen.jeroen'); | $admin = $this->getTestUser('jeroen@jeroen.jeroen'); | ||||
$reseller1 = $this->getTestUser('reseller@' . \config('app.domain')); | $reseller1 = $this->getTestUser('reseller@' . \config('app.domain')); | ||||
▲ Show 20 Lines • Show All 91 Lines • Show Last 20 Lines |