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/>.
**/
class ScheduledReports {
/**
* Create data for testFormReports test.
*
* @return array
*/
public static function load() {
CDataHelper::call('user.create', [
[
'username' => 'admin user for testFormScheduledReport',
'passwd' => 'xibbaz123',
'roleid' => 2,
'usrgrps' => [
[
'usrgrpid' => 7
]
]
],
[
'username' => 'user-recipient of the report',
'passwd' => 'xibbaz123',
'roleid' => 2,
'usrgrps' => [
[
'usrgrpid' => 7
]
]
]
]);
$userids = CDataHelper::getIds('username');
CDataHelper::call('report.create', [
[
'userid' => '1',
'name' => 'Report for update',
'dashboardid' => '1',
'period' => '1',
'cycle' => '1',
'start_time' => '43200', // 12:00
'weekdays' => '12', // Wednesday and Thursday
'active_since' => '2025-04-24',
'active_till' => '2026-04-25',
'subject' => 'Weekly report',
'message' => 'Report accompanying text',
'status' => '0',
'description' => 'Weekly report description',
'users' => [