Source
<?php
/*
** Zabbix
** 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 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.
**/
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',