Changeset View
Changeset View
Standalone View
Standalone View
src/tests/Feature/Controller/UsersTest.php
Show First 20 Lines • Show All 305 Lines • ▼ Show 20 Lines | public function testStatus(): void | ||||
$this->assertFalse($json['isImapReady']); | $this->assertFalse($json['isImapReady']); | ||||
$this->assertFalse($json['isReady']); | $this->assertFalse($json['isReady']); | ||||
$this->assertCount(7, $json['process']); | $this->assertCount(7, $json['process']); | ||||
$this->assertSame('user-imap-ready', $json['process'][2]['label']); | $this->assertSame('user-imap-ready', $json['process'][2]['label']); | ||||
$this->assertSame(false, $json['process'][2]['state']); | $this->assertSame(false, $json['process'][2]['state']); | ||||
$this->assertTrue(empty($json['status'])); | $this->assertTrue(empty($json['status'])); | ||||
$this->assertTrue(empty($json['message'])); | $this->assertTrue(empty($json['message'])); | ||||
// Now "reboot" the process and verify the user in imap syncronously | // Make sure the domain is confirmed (other test might unset that status) | ||||
$domain = $this->getTestDomain('kolab.org'); | |||||
$domain->status |= Domain::STATUS_CONFIRMED; | |||||
$domain->save(); | |||||
// Now "reboot" the process and verify the user in imap synchronously | |||||
$response = $this->actingAs($john)->get("/api/v4/users/{$john->id}/status?refresh=1"); | $response = $this->actingAs($john)->get("/api/v4/users/{$john->id}/status?refresh=1"); | ||||
$response->assertStatus(200); | $response->assertStatus(200); | ||||
$json = $response->json(); | $json = $response->json(); | ||||
$this->assertTrue($json['isImapReady']); | $this->assertTrue($json['isImapReady']); | ||||
$this->assertTrue($json['isReady']); | $this->assertTrue($json['isReady']); | ||||
$this->assertCount(7, $json['process']); | $this->assertCount(7, $json['process']); | ||||
▲ Show 20 Lines • Show All 529 Lines • Show Last 20 Lines |