mirror of
https://github.com/Combodo/iTop.git
synced 2026-02-13 07:24:13 +01:00
✅ Fix interferences between tests on dictionaries
This commit is contained in:
@@ -19,6 +19,20 @@ class DictionariesConsistencyAfterSetupTest extends ItopTestCase
|
||||
"Class:TriggerOnThresholdReached/Attribute:threshold_index+"
|
||||
];
|
||||
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp(); // TODO: Change the autogenerated stub
|
||||
|
||||
// Cleanup the entry 'ITOP::DICT:FORMAT:BROKEN:KEY' introduced by some dirty tests
|
||||
$aDictEntriesByLanguage = $this->GetNonPublicStaticProperty(\Dict::class, 'm_aData', []);
|
||||
foreach ($aDictEntriesByLanguage as $sLangCode => &$aDictEntries) {
|
||||
if (array_key_exists('ITOP::DICT:FORMAT:BROKEN:KEY', $aDictEntries)) {
|
||||
unset($aDictEntries['ITOP::DICT:FORMAT:BROKEN:KEY']);
|
||||
}
|
||||
}
|
||||
$this->SetNonPublicStaticProperty(\Dict::class, 'm_aData', $aDictEntriesByLanguage);
|
||||
}
|
||||
|
||||
public function FormatProvider(){
|
||||
return [
|
||||
'key does not exist in dictionnary' => [
|
||||
|
||||
Reference in New Issue
Block a user