mirror of
https://github.com/Combodo/iTop.git
synced 2026-05-19 23:32:17 +02:00
N°6384 - Flag LinkedSet (Indirect) when CheckToWrite must be requested to Hosted Object
This commit is contained in:
@@ -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],
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -61,6 +61,16 @@
|
||||
<field id="status" xsi:type="AttributeLinkedSetIndirect"/>
|
||||
</fields>
|
||||
</class>
|
||||
<class id="ClassWithAttributeLinkedSetWithConstraint">
|
||||
<fields>
|
||||
<field id="status" xsi:type="AttributeLinkedSet"/>
|
||||
</fields>
|
||||
</class>
|
||||
<class id="ClassWithAttributeLinkedSetIndirectWithConstraint">
|
||||
<fields>
|
||||
<field id="status" xsi:type="AttributeLinkedSetIndirect"/>
|
||||
</fields>
|
||||
</class>
|
||||
<class id="ClassWithAttributeEnumSorted">
|
||||
<fields>
|
||||
<field id="enum_unsorted" xsi:type="AttributeEnum">
|
||||
|
||||
@@ -89,6 +89,20 @@
|
||||
</field>
|
||||
</fields>
|
||||
</class>
|
||||
<class id="ClassWithAttributeLinkedSetWithConstraint">
|
||||
<fields>
|
||||
<field id="status" xsi:type="AttributeLinkedSet">
|
||||
<with_constrain>true</with_constrain>
|
||||
</field>
|
||||
</fields>
|
||||
</class>
|
||||
<class id="ClassWithAttributeLinkedSetIndirectWithConstraint">
|
||||
<fields>
|
||||
<field id="status" xsi:type="AttributeLinkedSetIndirect">
|
||||
<with_constrain>true</with_constrain>
|
||||
</field>
|
||||
</fields>
|
||||
</class>
|
||||
<class id="ClassWithAttributeEnumSorted">
|
||||
<fields>
|
||||
<field id="enum_unsorted" xsi:type="AttributeEnum">
|
||||
|
||||
Reference in New Issue
Block a user