Source
'expected_error' => 'Invalid parameter "/output/1": value must be one of "connectorid", "name", "protocol", "data_type", "url", "item_value_type", "authtype", "username", "password", "token", "max_records", "max_senders", "max_attempts", "attempt_interval", "timeout", "http_proxy", "verify_peer", "verify_host", "ssl_cert_file", "ssl_key_file", "ssl_key_password", "description", "status", "tags_evaltype".'
<?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';
/**
* @onBefore prepareTestData
*
* @onAfter clearData
*/
class testConnector extends CAPITest {
/**
* Non-existent ID.
*/
private const INVALID_ID = self::INVALID_NUMBER;
/**
* Invalid protocol, data_type, status etc.
*/
private const INVALID_NUMBER = 999999;
/**
* @var array
*/
private static array $data = [
'connectorids' => [],
// Created connectors during connector.create test (deleted at the end).
'created' => []
];
/**
* Prepare data for tests.
*/
public function prepareTestData(): void {
$connectors = [
'get_custom_defaults' => [
'name' => 'API test connector.get with custom defaults',
'url' => 'http://localhost/',
'description' => 'Custom description'
],
'get_data_type_events' => [
'name' => 'API test connector.get with data type (events)',
'data_type' => ZBX_CONNECTOR_DATA_TYPE_EVENTS,
'url' => 'http://localhost/'
],
'get_url' => [
'name' => 'API test connector.get with URL (user macro)',
'url' => '{$URL}'