Source
<?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__).'/../../include/CWebTest.php';
require_once dirname(__FILE__).'/../behaviors/CMessageBehavior.php';
require_once dirname(__FILE__).'/../behaviors/CPreprocessingBehavior.php';
/**
* Base class for "Test item" function tests.
*/
class testItemTest extends CWebTest {
/**
* Attach PreprocessingBehavior and MessageBehavior to the test.
*
* @return array
*/
public function getBehaviors() {
return [
CMessageBehavior::class,
CPreprocessingBehavior::class
];
}
const HOST_ID = 99136; // 'Test item host' monitored by 'Active proxy 1'
const TEMPLATE_ID = 99137; // 'Test Item Template'
/**
* Test item button state data for item, item prototype and LLD.
*/
public function getCommonTestButtonStateData() {
return [
['Type' => 'Zabbix agent'],
['Type' => 'Zabbix agent (active)'],
['Type' => 'Simple check'],
['Type' => 'SNMP agent','SNMP OID' => '[IF-MIB::]ifInOctets.1'],
['Type' => 'Zabbix internal'],
['Type' => 'Zabbix trapper'],
['Type' => 'External check'],
['Type' => 'Database monitor', 'SQL query' => 'query'],
['Type' => 'HTTP agent', 'URL' => 'https://www.zabbix.com'],
['Type' => 'IPMI agent', 'IPMI sensor' => 'Sensor'],
['Type' => 'SSH agent', 'Key' => 'ssh.run[Description,127.0.0.1,50]', 'User name' => 'Name', 'Executed script' => 'Script'],
['Type' => 'TELNET agent', 'Key' => 'telnet'],
['Type' => 'JMX agent', 'Key' => 'jmx','JMX endpoint' => 'service:jmx:rmi:///jndi/rmi://{HOST.CONN}:{HOST.PORT}/jmxrmi', 'User name' => ''],