Source
'expected_error' => 'Item will not be refreshed. Specified update interval requires having at least one either flexible or scheduling interval.'
<?php
/*
** Zabbix
** Copyright (C) 2001-2022 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__).'/../include/CAPITest.php';
require_once dirname(__FILE__).'/../include/helpers/CDataHelper.php';
/**
* @backup items
* @onBefore prepareUpdateData
*/
class testItem extends CAPITest {
protected static $items;
public static function getItemCreateData() {
$valid_item_types = [
ITEM_TYPE_ZABBIX => '50022',
ITEM_TYPE_TRAPPER => null,
ITEM_TYPE_SIMPLE => '50022',
ITEM_TYPE_INTERNAL => null,
ITEM_TYPE_ZABBIX_ACTIVE => null,
ITEM_TYPE_EXTERNAL => '50022',
ITEM_TYPE_DB_MONITOR => null,
ITEM_TYPE_IPMI => '50031',
ITEM_TYPE_SSH => '50022',
ITEM_TYPE_TELNET => '50022',
ITEM_TYPE_CALCULATED => null,
ITEM_TYPE_JMX => '50030',
ITEM_TYPE_DEPENDENT => null,
ITEM_TYPE_HTTPAGENT => '50022',
ITEM_TYPE_SNMP => '50029',
ITEM_TYPE_SCRIPT => '50022'
];
$item_type_tests = [];
foreach ($valid_item_types as $type => $interfaceid) {
switch ($type) {
case ITEM_TYPE_IPMI:
$params = [
'ipmi_sensor' => '1.2.3'
];
break;
case ITEM_TYPE_TRAPPER:
$params = [