N°6228 - CheckToWrite() propagation to target objects based on with_php_constraint property

This commit is contained in:
Pierre Goiffon
2023-11-14 12:02:45 +01:00
committed by Eric Espie
parent 9a59bc7890
commit ea845dc6eb
17 changed files with 703 additions and 465 deletions

View File

@@ -488,29 +488,4 @@ 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],
];
}
}