Source
* Check that status of host is changed in groups table when change host status in overlay dialog on host group page.
<?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__).'/../common/testPageGroups.php';
require_once dirname(__FILE__).'/../behaviors/CMessageBehavior.php';
require_once dirname(__FILE__).'/../behaviors/CTableBehavior.php';
/**
* @backup hosts
*
* @onBefore preparePageHostGroupsData
*
* @dataSource DiscoveredHosts, HostTemplateGroups
*/
class testPageHostGroups extends testPageGroups {
/**
* Attach TableBehavior to set column names and MessageBehavior to the test.
*
* @return array
*/
public function getBehaviors() {
return [
CMessageBehavior::class,
[
'class' => CTableBehavior::class,
'column_names' => ['', 'Name', 'Count', 'Hosts', 'Info']
]
];
}
protected $link = 'zabbix.php?action=hostgroup.list';
protected $object = 'host';
const DISCOVERED_HOST = 'Discovered host from prototype 1';
const GROUP = 'Group with two disabled hosts testPageHostGroup';
const HOST1 = 'One disabled host testPageHostGroup';
const HOST2 = 'Two disabled host testPageHostGroup';
/**
* Prepare data for enable/disable hosts test.
*/
public static function preparePageHostGroupsData() {
// Create three groups with disabled hosts and two groups with enabled hosts for testing.
CDataHelper::call('hostgroup.create', [
[
'name' => self::GROUP
],
[
'name' => 'Group with disabled host testPageHostGroup'
],