Source
$this->query('class:list-table')->asTable()->one()->findRow('Name', 'Template that linked to template: Drule for template')
<?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 dirname(__FILE__).'/../common/testTriggerDependencies.php';
/**
* @backup hosts
*
* @onBefore prepareTemplateTriggersData
*/
class testTemplateTriggerDependencies extends testTriggerDependencies {
protected static $templateids;
protected static $template_druleids;
public function prepareTemplateTriggersData() {
$template_result = CDataHelper::createTemplates([
[
'host' => 'Template with everything',
'groups' => ['groupid' => 1],
'items' => [
[
'name' => 'template item for everything',
'key_' => 'everything',
'type' => ITEM_TYPE_TRAPPER,
'value_type' => ITEM_VALUE_TYPE_UINT64,
'delay' => 0
]
],
'discoveryrules' => [
[
'name' => 'Drule for everything',
'key_' => 'everything_drule',
'type' => ITEM_TYPE_TRAPPER,
'delay' => 0
]
]
],
[
'host' => 'Template that linked to host',
'groups' => ['groupid' => 1],
'items' => [
[
'name' => 'template item for linking',
'key_' => 'everything_2',
'type' => ITEM_TYPE_TRAPPER,
'value_type' => ITEM_VALUE_TYPE_UINT64,
'delay' => 0
]
],