Source
'error' => 'Cannot set dependency for item prototype with key "template.overflow.item.prototype[{#LLD}]" on the master item prototype with key "template.dependent.item.prototype.level.last[{#LLD}]" on the template "t.dep": allowed count of dependency levels would be exceeded.'
<?php
/*
** Copyright (C) 2001-2025 Zabbix SIA
**
** This program is free software: you can redistribute it and/or modify it under the terms of
** the GNU Affero General Public License as published by the Free Software Foundation, version 3.
**
** This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
** without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
** See the GNU Affero General Public License for more details.
**
** You should have received a copy of the GNU Affero General Public License along with this program.
** If not, see <https://www.gnu.org/licenses/>.
**/
require_once __DIR__.'/../include/CAPITest.php';
require_once __DIR__.'/../include/helpers/CTestDataHelper.php';
/**
* @onBefore prepareTestData
* @onAfter cleanTestData
*/
class testDependentItems extends CAPITest {
public static function prepareTestData(): void {
// Do nothing if test will be skipped.
if (ZBX_DEPENDENT_ITEM_MAX_COUNT > 299) {
return;
}
CTestDataHelper::createObjects([
'template_groups' => [
['name' => 'dependent.items.tests.template.group']
],
'host_groups' => [
['name' => 'dependent.items.tests.host.group']
],
'templates' => [
[
'host' => 't.dep',
'items' => [
['key_' => 'template.master.item'],
[
'key_' => 'template.dependent.item',
'master_itemid' => ':item:template.master.item'
],
[
'key_' => 'template.dependent.descendant',
'master_itemid' => ':item:template.dependent.item'
],
[
'key_' => 'template.dependent.level.last',
'master_itemid' => ':item:template.dependent.descendant'
],
['key_' => 'template.overflow.item']
],
'lld_rules' => [
['key_' => 'template.discovery.rule.update'],
[
'key_' => 'template.discovery.rule',
'item_prototypes' => [
['key_' => 'template.master.item.prototype[{#LLD}]'],