Source
'expected_error' => 'Invalid parameter "/output/3": value must be one of "ha_nodeid", "name", "address", "port", "lastaccess", "status".'
<?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';
require_once __DIR__.'/../../include/classes/helpers/CCuid.php';
/**
* @backup ha_node
*/
class testHaNode extends CAPITest {
public static function hanode_get_cases() {
return [
'No params' => [
'request' => [],
'expected_error' => null
],
'Too short ha_nodeid' => [
'request' => [
'ha_nodeids' => 'æų'
],
'expected_error' => 'Invalid parameter "/ha_nodeids": an array is expected.'
],
'Integer ha_nodeids' => [
'request' => [
'ha_nodeids' => 7
],
'expected_error' => 'Invalid parameter "/ha_nodeids": an array is expected.'
],
'Empty ha_nodeids' => [
'request' => [
'ha_nodeids' => ''
],
'expected_error' => 'Invalid parameter "/ha_nodeids": an array is expected.'
],
'Null ha_nodeids' => [
'request' => [
'ha_nodeids' => null
],
'expected_error' => null
],
'Unexpected param' => [
'request' => [
'flag' => true
],
'expected_error' => 'Invalid parameter "/": unexpected parameter "flag".'
],
'Non-existing status' => [
'request' => [
'filter' => [