Source
'expected_error' => 'Invalid parameter "/selectProxies/1": value must be one of "proxyid", "name", "local_address", "local_port", "operating_mode", "allowed_addresses", "address", "port", "description", "tls_connect", "tls_accept", "tls_issuer", "tls_subject", "custom_timeouts", "timeout_zabbix_agent", "timeout_simple_check", "timeout_snmp_agent", "timeout_external_check", "timeout_db_monitor", "timeout_http_agent", "timeout_ssh_agent", "timeout_telnet_agent", "timeout_script", "timeout_browser", "lastaccess", "version", "compatibility", "state".'
<?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 __DIR__.'/../include/CAPITest.php';
/**
* @backup ids
*
* @onBefore prepareTestData
* @onAfter clearData
*/
class testProxyGroup extends CAPITest {
/**
* Non-existent ID, type, status etc.
*/
private const INVALID_NUMBER = 999999;
/**
* @var array
*/
private static array $data = [
'proxy_groupids' => [],
'proxyids' => [],
'groupids' => [],
'hostids' => [],
// Created proxy groups during proxygroup.create test (deleted at the end).
'created' => []
];
/**
* Prepare data for tests. Create proxy groups, proxies, host groups, hosts.
*/
public function prepareTestData(): void {
$this->prepareTestDataProxyGroups();
$this->prepareTestDataProxies();
$this->prepareTestDataHostGroups();
$this->prepareTestDataHosts();
}
/**
* Create proxy groups.
*/
private function prepareTestDataProxyGroups(): void {
$proxy_groups = [
'defaults' => [
'name' => 'API test proxy group - with defaults'
],
'with_1_proxy' => [