Source
public function testUrlParameters_UrlLoad($title, $check_server_name, $server_name_on_page, $test_cases) {
<?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 dirname(__FILE__).'/../include/CLegacyWebTest.php';
class testUrlParameters extends CLegacyWebTest {
public static function data() {
return [
[
'title' => 'Configuration of host group',
'check_server_name' => true,
'server_name_on_page' => false,
'test_cases' => [
[
'url' => 'zabbix.php?action=hostgroup.edit&groupid=4',
'text_present' => 'Host groups'
],
[
'url' => 'zabbix.php?action=hostgroup.edit&groupid=9999999',
'text_not_present' => 'Host groups',
'access_denied' => true,
'text_present' => [
'You are logged in as "Admin". You have no permissions to access this page.'
]
]
]
],
[
'title' => 'Fatal error, please report to the Zabbix team',
'check_server_name' => true,
'server_name_on_page' => false,
'test_cases' => [
[
'url' => 'zabbix.php?action=hostgroup.edit&groupid=abc',
'text_not_present' => 'Host groups',
'fatal_error' => true,
'text_present' => [
'Incorrect value "abc" for "groupid" field.',
'Controller: hostgroup.edit',
'action: hostgroup.edit',
'groupid: abc'
]
],
[
'url' => 'zabbix.php?action=hostgroup.edit&groupid[]=1',
'text_not_present' => 'Host groups',
'fatal_error' => true,
'text_present' => [
'Incorrect value for "groupid" field.',
'Controller: hostgroup.edit',
'action: hostgroup.edit',
'groupid: array'
]
],
[
'url' => 'zabbix.php?action=hostgroup.edit&name[]=name',
'text_not_present' => 'Host groups',
'fatal_error' => true,
'text_present' => [
'Incorrect value for field "name": a character string is expected.',
'Controller: hostgroup.edit',
'action: hostgroup.edit',
'name: array'
]
],
[
'url' => 'zabbix.php?action=hostgroup.edit&subgroups[]=1',
'text_not_present' => 'Host groups',
'fatal_error' => true,
'text_present' => [
'Incorrect value for "subgroups" field.',
'Controller: hostgroup.edit',
'action: hostgroup.edit',
'subgroups: array'
]
],
[