Source
DBexecute('INSERT INTO group_discovery (groupdiscoveryid, groupid, parent_group_prototypeid, name, lastcheck, ts_delete)'.
<?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/>.
**/
/**
* 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'
],
[
'name' => 'One group belongs to one object for Delete test'
],
[