Changeset View
Changeset View
Standalone View
Standalone View
src/tests/Feature/Controller/DomainsTest.php
Show First 20 Lines • Show All 223 Lines • ▼ Show 20 Lines | public function testStatus(): void | ||||
// Now "reboot" the process and verify the domain | // Now "reboot" the process and verify the domain | ||||
$response = $this->actingAs($john)->get("/api/v4/domains/{$domain->id}/status?refresh=1"); | $response = $this->actingAs($john)->get("/api/v4/domains/{$domain->id}/status?refresh=1"); | ||||
$response->assertStatus(200); | $response->assertStatus(200); | ||||
$json = $response->json(); | $json = $response->json(); | ||||
$this->assertTrue($json['isVerified']); | $this->assertTrue($json['isVerified']); | ||||
$this->assertFalse($json['isReady']); | $this->assertTrue($json['isReady']); | ||||
$this->assertCount(4, $json['process']); | $this->assertCount(4, $json['process']); | ||||
$this->assertSame('domain-verified', $json['process'][2]['label']); | $this->assertSame('domain-verified', $json['process'][2]['label']); | ||||
$this->assertSame(true, $json['process'][2]['state']); | $this->assertSame(true, $json['process'][2]['state']); | ||||
$this->assertSame('domain-confirmed', $json['process'][3]['label']); | $this->assertSame('domain-confirmed', $json['process'][3]['label']); | ||||
$this->assertSame(false, $json['process'][3]['state']); | $this->assertSame(true, $json['process'][3]['state']); | ||||
$this->assertSame('error', $json['status']); | $this->assertSame('success', $json['status']); | ||||
$this->assertSame('Failed to verify an ownership of a domain.', $json['message']); | $this->assertSame('Setup process finished successfully.', $json['message']); | ||||
// TODO: Test completing all process steps | // TODO: Test completing all process steps | ||||
} | } | ||||
} | } |