Source
'expected_error' => 'Invalid parameter "/output/3": value must be one of "ha_nodeid", "name", "address", "port", "lastaccess", "status".'
<?php
/*
** Zabbix
** Copyright (C) 2001-2023 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 __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
],