diff options
author | Alexander Vladishev <aleksander.vladishev@zabbix.com> | 2020-09-03 08:57:52 +0300 |
---|---|---|
committer | Alexander Vladishev <aleksander.vladishev@zabbix.com> | 2020-09-03 08:58:11 +0300 |
commit | 2b5d3ff9f4debca8ec8759bf47743d69ec703e21 (patch) | |
tree | 893c910b73423cda4b4c8464f33630badd0236ef | |
parent | dc91fd6b576f8c33a092c60fa64e9060ea2b2874 (diff) |
.......... [DEV-1573] fixed false-positives testDiscoveryRuleOverrides_Copy test
(cherry picked from commit f70d4929094b2142b4bbaa1bad0bf31831a59259)
-rw-r--r-- | ui/tests/api_json/testDiscoveryRule.php | 34 |
1 files changed, 32 insertions, 2 deletions
diff --git a/ui/tests/api_json/testDiscoveryRule.php b/ui/tests/api_json/testDiscoveryRule.php index 76fe8414130..22d9b0be83c 100644 --- a/ui/tests/api_json/testDiscoveryRule.php +++ b/ui/tests/api_json/testDiscoveryRule.php @@ -5389,7 +5389,22 @@ class testDiscoveryRule extends CAPITest { foreach ($expected_overrides as &$override) { usort($override['filter']['conditions'], function ($a, $b) { return $a['formulaid'] <=> $b['formulaid']; - });; + }); + + foreach ($override['operations'] as &$operation) { + if (array_key_exists('optag', $operation)) { + usort($operation['optag'], function ($a, $b) { + return $a['tag'] <=> $b['tag']; + }); + } + + if (array_key_exists('optemplate', $operation)) { + usort($operation['optemplate'], function ($a, $b) { + return $a['templateid'] <=> $b['templateid']; + }); + } + } + unset($operation); } unset($override); @@ -5412,7 +5427,22 @@ class testDiscoveryRule extends CAPITest { foreach ($lld_rule['overrides'] as &$override) { usort($override['filter']['conditions'], function ($a, $b) { return $a['formulaid'] <=> $b['formulaid']; - });; + }); + + foreach ($override['operations'] as &$operation) { + if (array_key_exists('optag', $operation)) { + usort($operation['optag'], function ($a, $b) { + return $a['tag'] <=> $b['tag']; + }); + } + + if (array_key_exists('optemplate', $operation)) { + usort($operation['optemplate'], function ($a, $b) { + return $a['templateid'] <=> $b['templateid']; + }); + } + } + unset($operation); } unset($override); |