Source
<?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 preparePageTemplateGroupsData
*
* @dataSource HostTemplateGroups
*/
class testPageTemplateGroups 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', 'Templates']
]
];
}
protected $link = 'zabbix.php?action=templategroup.list';
protected $object = 'template';
const GROUP1 = 'Group with one template testPageTemplateGroup';
const TEMPLATE1_1 = 'Template for testPageHostGroup';
const GROUP2 = 'Group with two templates testPageTemplateGroup';
const TEMPLATE2_1 = 'One template for testPageHostGroup';
const TEMPLATE2_2 = 'Two template for testPageHostGroup';
/**
* Prepare data for template groups test.
*/
public static function preparePageTemplateGroupsData() {
// Create three groups with disabled hosts and two groups with enabled hosts for testing.
CDataHelper::call('templategroup.create', [
[
'name' => 'Templates/testPageTemplateGroup'
],
[
'name' => self::GROUP1