Skip to content

Commit

Permalink
Add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
accognet committed Jan 31, 2025
1 parent 701ba0a commit 5d5866f
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/php-unit-tests/unitary-tests/core/UserRightsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -552,4 +552,18 @@ public function FindUserAndAssertItWasNotFound($sLogin)
$oUser = $this->InvokeNonPublicStaticMethod(UserRights::class, "FindUser", [$sLogin]);
static::assertNull($oUser, 'FindUser should return null when the login is unknown');
}

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'));
}
}

0 comments on commit 5d5866f

Please sign in to comment.