Source
'expected_error' => 'Invalid parameter "/output/1": value must be one of auditid, userid, clock, action, resourcetype, note, ip, resourceid, resourcename.'
<?php
/*
** Zabbix
** Copyright (C) 2001-2022 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.
**/
require_once dirname(__FILE__).'/../include/CAPITest.php';
/**
* @onBefore enableUserGroup
* @onAfter disableUserGroup
*/
class testAuditLog extends CAPITest {
public static function getAuditLogData() {
return [
// API request with all possible values.
[
'api_request' => [
'userids' => '1',
'time_from' => '1582268400', // 2020-02-21 09:00
'time_till' => '1582270200', // 2020-02-21 09:30
'selectDetails' => ['field_name', 'oldvalue', 'newvalue'],
'output' => ['auditid', 'userid', 'clock', 'action', 'resourcetype', 'ip', 'resourceid', 'resourcename', 'note'],
'filter' => [
'auditid' => ['9000', '9001'],
'userid' => ['1', '3'],
'clock' => ['1582269000', '1582270260'],
'action' => ['1', '0'],
'resourcetype' => ['4', '6'],
'ip' => ['::1', '127.0.0.1'],
'resourceid' => ['10054', '0'],
'resourcename' => 'H1 updated',
'note' => '',
'table_name' => 'hosts',
'field_name' => 'status'
],
'search' => [
'ip' => '1',
'resourcename' => 'updated',
'oldvalue' => '0',
'newvalue' => '1'
],
'sortfield' => ['userid', 'auditid'],
'sortorder' => 'DESC',
'limit' => '5'
],
'expected_result' => [
[