From 060b17df011a0effff70a94307baf948a5f96908 Mon Sep 17 00:00:00 2001 From: snipe Date: Sat, 22 Jun 2024 20:34:49 +0100 Subject: [PATCH] Pulled duplicated test Signed-off-by: snipe --- tests/Feature/Users/Api/ViewUserTest.php | 38 ------------------------ 1 file changed, 38 deletions(-) diff --git a/tests/Feature/Users/Api/ViewUserTest.php b/tests/Feature/Users/Api/ViewUserTest.php index 8593336989..07346dbbb8 100644 --- a/tests/Feature/Users/Api/ViewUserTest.php +++ b/tests/Feature/Users/Api/ViewUserTest.php @@ -20,42 +20,4 @@ class ViewUserTest extends TestCase ->assertOk(); } - public function testPermissionsWithCompanyableToDeleteUser() - { - - $this->settings->enableMultipleFullCompanySupport(); - - [$companyA, $companyB] = Company::factory()->count(2)->create(); - - $superuser = User::factory()->superuser()->create(); - $userFromA = User::factory()->for($companyA)->create(); - $userFromB = User::factory()->for($companyB)->create(); - - $this->actingAsForApi(User::factory()->deleteUsers()->for($companyA)->create()) - ->deleteJson(route('api.users.destroy', $userFromA->id)) - ->assertOk() - ->assertStatus(200) - ->assertStatusMessageIs('success') - ->json(); - - $this->actingAsForApi(User::factory()->deleteUsers()->for($companyB)->create()) - ->deleteJson(route('api.users.destroy', $userFromA->id)) - ->assertStatus(403); - - $this->actingAsForApi($superuser) - ->deleteJson(route('api.users.destroy', $userFromA->id)) - ->assertOk() - ->assertStatus(200) - ->assertStatusMessageIs('success') - ->json(); - - $this->actingAsForApi($superuser) - ->deleteJson(route('api.users.destroy', $userFromB->id)) - ->assertOk() - ->assertStatus(200) - ->assertStatusMessageIs('success') - ->json(); - - } - }