Add tests

This commit is contained in:
Anne-Cath
2024-12-16 14:56:23 +01:00
parent 77989b6bd8
commit 2415d3d5d3

View File

@@ -488,4 +488,18 @@ class UserRightsTest extends ItopDataTestCase
'with Admins hidden' => [true, 0],
];
}
public function testGetOwnerOrganizationAttCode()
{
$this->assertEquals('id', UserRights::GetOwnerOrganizationAttCode('Organization'));
$this->assertEquals('org_id', UserRights::GetOwnerOrganizationAttCode('Server'));
$this->assertEquals('org_id', UserRights::GetOwnerOrganizationAttCode('UserRequest'));
$this->assertEquals('item_org_id', UserRights::GetOwnerOrganizationAttCode('InlineImage'));
$this->assertEquals('item_org_id', UserRights::GetOwnerOrganizationAttCode('Attachment'));
$this->assertNull(UserRights::GetOwnerOrganizationAttCode('TriggerOnObjectCreation'));
$this->assertNull(UserRights::GetOwnerOrganizationAttCode('lnkPersonToTeam'));
}
}