Changeset View
Changeset View
Standalone View
Standalone View
src/tests/Feature/Controller/Admin/DomainsTest.php
Show First 20 Lines • Show All 150 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 admins | // This end-point does not exist for admins | ||||
$response = $this->actingAs($admin)->get("/api/v4/domains/{$domain->id}/status"); | $response = $this->actingAs($admin)->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 | |||||
{ | |||||
$admin = $this->getTestUser('jeroen@jeroen.jeroen'); | |||||
// Admins can't create domains | |||||
$response = $this->actingAs($admin)->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 | ||||
$domain = $this->getTestDomain('domainscontroller.com', [ | $domain = $this->getTestDomain('domainscontroller.com', [ | ||||
'status' => Domain::STATUS_NEW, | 'status' => Domain::STATUS_NEW, | ||||
▲ Show 20 Lines • Show All 57 Lines • Show Last 20 Lines |