N°6384 - Flag LinkedSet (Indirect) when CheckToWrite must be requested to Hosted Object

This commit is contained in:
Eric Espie
2023-06-08 17:06:49 +02:00
parent 55009b53e2
commit 7ebf5a6dd4
8 changed files with 73 additions and 3 deletions

View File

@@ -527,4 +527,29 @@ class UserRightsTest extends ItopDataTestCase
'with Admins hidden' => [true, 0],
];
}
/**
* @dataProvider WithConstraintParameterProvider
* @param string $sClass
* @param string $sAttCode
* @param bool $bExpected
*
* @return void
* @throws \Exception
*/
public function testWithConstraintParameter(string $sClass, string $sAttCode, bool $bExpected)
{
$oAttDef = \MetaModel::GetAttributeDef($sClass, $sAttCode);
$this->assertTrue(method_exists($oAttDef, "GetHasConstraint"));
$this->assertEquals($bExpected, $oAttDef->GetHasConstraint());
}
public function WithConstraintParameterProvider()
{
return [
['User', 'profile_list', true],
['User', 'allowed_org_list', true],
['Person', 'team_list', false],
];
}
}