Fixed problem with merge into when project members already exist in destination member

This commit is contained in:
Constantin Graf
2025-03-10 13:46:57 +01:00
committed by Constantin Graf
parent 02a716897d
commit 73ce5f793d
7 changed files with 190 additions and 43 deletions

View File

@@ -59,22 +59,6 @@ class UserServiceTest extends TestCase
$this->assertSame(0, ProjectMember::query()->whereBelongsTo($fromUser, 'user')->count());
}
public function test_assign_organization_entities_to_different_user_fails_if_new_user_is_not_member_of_organization(): void
{
// Arrange
$organization = Organization::factory()->create();
$fromUser = User::factory()->create();
$toUser = User::factory()->create();
$fromUserMember = Member::factory()->forOrganization($organization)->forUser($fromUser)->create();
// Act
try {
$this->userService->assignOrganizationEntitiesToDifferentUser($organization, $fromUser, $toUser);
} catch (\InvalidArgumentException $e) {
$this->assertSame('User is not a member of the organization', $e->getMessage());
}
}
public function test_change_ownership_changes_ownership_of_organization_to_new_user(): void
{
// Arrange