Source
$link = 'items.php?form=update&context=host&hostid='.self::INHERITANCE_HOSTID.'&itemid='.self::INHERITED_ITEMID;
<?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/testFormPreprocessing.php';
require_once dirname(__FILE__).'/../../include/helpers/CDataHelper.php';
/**
* @backup items
*/
class testFormPreprocessingItem extends testFormPreprocessing {
public $link = 'items.php?filter_set=1&context=host&filter_hostids[0]='.self::HOSTID;
public $ready_link = 'items.php?form=update&context=host&hostid='.self::HOSTID.'&itemid=';
public $button = 'Create item';
public $success_message = 'Item added';
public $fail_message = 'Cannot add item';
const HOSTID = 40001; // 'Simple form test host'
const INHERITANCE_TEMPLATEID = 15000; // 'Inheritance test template'
const INHERITANCE_HOSTID = 15001; // 'Template inheritance test host'
const INHERITED_ITEMID = 15094; // 'testInheritanceItemPreprocessing'
const CLONE_ITEMID = 99102; // 'Simple form test host' -> 'testFormItem'
public function getItemPreprocessingPrometheusData() {
return array_merge($this->getPrometheusData(), [
[
[
'expected' => TEST_BAD,
'fields' => [
'Name' => 'Item Prometeus wrong first parameter - LLD macro',
'Key' => 'wrong-first-parameter-macro'
],
'preprocessing' => [
['type' => 'Prometheus pattern', 'parameter_1' => '{#METRICNAME}==1']
],
'error' => 'Incorrect value for field "params": invalid Prometheus pattern.'
]
],
[
[
'expected' => TEST_BAD,
'fields' => [
'Name' => 'Item Prometeus wrong second parameter - LLD macro',
'Key' => 'wrong-second-parameter-macro'
],