Source
<?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.
**/
/**
* Create data for host and template groups test.
*/
class HostTemplateGroups {
public static function load() {
// Prepare data for template groups.
CDataHelper::call('templategroup.create', [
[
'name' => 'Group empty for Delete test'
],
[
'name' => 'One group belongs to one object for Delete test'
],
[
'name' => 'First group to one object for Delete test'
],
[
'name' => 'Second group to one object for Delete test'
]
]);
$template_groupids = CDataHelper::getIds('name');
CDataHelper::createTemplates([
[
'host' => 'Template for template group testing',
'groups' => [
'groupid' => $template_groupids['One group belongs to one object for Delete test']
]
],
[
'host' => 'Template with two groups',
'groups' => [
['groupid' => $template_groupids['First group to one object for Delete test']],
['groupid' => $template_groupids['Second group to one object for Delete test']]
]
]
]);
// Prepare data for host groups.
CDataHelper::call('hostgroup.create', [
[
'name' => 'Group empty for Delete test'