admin = UserFactory::refresh()->asAdmin()->withTokens()->create(); $this->manager = UserFactory::refresh()->asManager()->withTokens()->create(); $this->auditor = UserFactory::refresh()->asAuditor()->withTokens()->create(); $this->user = UserFactory::refresh()->asUser()->withTokens()->create(); } public function test_list_as_admin(): void { $response = $this->actingAs($this->admin)->getJson(self::URI); $invitations = invitation::all()->toArray(); $response->assertJson($invitations); } public function test_list_as_manager(): void { $response = $this->actingAs($this->manager)->getJson(self::URI); $response->assertForbidden(); } public function test_list_as_auditor(): void { $response = $this->actingAs($this->auditor)->getJson(self::URI); $response->assertForbidden(); } public function test_list_as_user(): void { $response = $this->actingAs($this->user)->getJson(self::URI); $response->assertForbidden(); } }