Source
xxxxxxxxxx
$this->query('class:list-table')->asTable()->one()->findRow('Name', 'Template that linked to template: Drule for template')
<?php
/*
** Zabbix
** 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 General Public License as published by
** the Free Software Foundation; either version 2 of the License, or
** (at your option) any later version.
**
** 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 General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program; if not, write to the Free Software
** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
**/
require_once dirname(__FILE__).'/../common/testTriggerDependencies.php';
/**
* @backup hosts
*
* @onBefore prepareTemplateTriggersData
*/
class testTemplateTriggerDependencies extends testTriggerDependencies {
protected static $templateids;
protected static $template_druleids;
protected static $trigger_protids;
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
]
],
'discoveryrules' => [
[
'name' => 'Drule for linking',
'key_' => 'linked_drule',
'type' => ITEM_TYPE_TRAPPER,
'delay' => 0
]
]
],
[
'host' => 'Template with linked template',
'groups' => ['groupid' => 1]
],
[
'host' => 'Template that linked to template',
'groups' => ['groupid' => 1],
'items' => [
[
'name' => 'template item for template',
'key_' => 'linked_temp',
'type' => ITEM_TYPE_TRAPPER,
'value_type' => ITEM_VALUE_TYPE_UINT64,