Changeset View
Changeset View
Standalone View
Standalone View
src/tests/Feature/Controller/Reseller/GroupsTest.php
Show First 20 Lines • Show All 80 Lines • ▼ Show 20 Lines | public function testIndex(): void | ||||
$response = $this->actingAs($reseller1)->get("api/v4/groups?owner={$user->id}"); | $response = $this->actingAs($reseller1)->get("api/v4/groups?owner={$user->id}"); | ||||
$response->assertStatus(200); | $response->assertStatus(200); | ||||
$json = $response->json(); | $json = $response->json(); | ||||
$this->assertSame(1, $json['count']); | $this->assertSame(1, $json['count']); | ||||
$this->assertCount(1, $json['list']); | $this->assertCount(1, $json['list']); | ||||
$this->assertSame($group->email, $json['list'][0]['email']); | $this->assertSame($group->email, $json['list'][0]['email']); | ||||
$this->assertSame($group->name, $json['list'][0]['name']); | |||||
// Search by owner (Ned is a controller on John's wallets, | // Search by owner (Ned is a controller on John's wallets, | ||||
// here we expect only domains assigned to Ned's wallet(s)) | // here we expect only domains assigned to Ned's wallet(s)) | ||||
$ned = $this->getTestUser('ned@kolab.org'); | $ned = $this->getTestUser('ned@kolab.org'); | ||||
$response = $this->actingAs($reseller1)->get("api/v4/groups?owner={$ned->id}"); | $response = $this->actingAs($reseller1)->get("api/v4/groups?owner={$ned->id}"); | ||||
$response->assertStatus(200); | $response->assertStatus(200); | ||||
$json = $response->json(); | $json = $response->json(); | ||||
▲ Show 20 Lines • Show All 42 Lines • ▼ Show 20 Lines | public function testShow(): void | ||||
$response = $this->actingAs($reseller1)->get("api/v4/groups/{$group->id}"); | $response = $this->actingAs($reseller1)->get("api/v4/groups/{$group->id}"); | ||||
$response->assertStatus(200); | $response->assertStatus(200); | ||||
$json = $response->json(); | $json = $response->json(); | ||||
$this->assertEquals($group->id, $json['id']); | $this->assertEquals($group->id, $json['id']); | ||||
$this->assertEquals($group->email, $json['email']); | $this->assertEquals($group->email, $json['email']); | ||||
$this->assertEquals($group->name, $json['name']); | |||||
$this->assertEquals($group->status, $json['status']); | $this->assertEquals($group->status, $json['status']); | ||||
} | } | ||||
/** | /** | ||||
* Test fetching group status (GET /api/v4/domains/<domain-id>/status) | * Test fetching group status (GET /api/v4/domains/<domain-id>/status) | ||||
*/ | */ | ||||
public function testStatus(): void | public function testStatus(): void | ||||
{ | { | ||||
▲ Show 20 Lines • Show All 124 Lines • Show Last 20 Lines |