Source
// Check if fields "Data storage period" and "Logs system action" are disabled when options are in all possible ways.
<?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/>.
**/
require_once dirname(__FILE__).'/../common/testFormAdministrationGeneral.php';
/**
* @backup config
*/
class testFormAdministrationAuditLog extends testFormAdministrationGeneral {
public $form_selector = 'id:audit-settings';
public $config_link = 'zabbix.php?action=audit.settings.edit';
public $default_values = [
'Enable audit logging' => true,
'Log system actions' => true,
'Enable internal housekeeping' => true,
'Data storage period' => '31d'
];
public $custom_values = [
'Enable audit logging' => true,
'Log system actions' => true,
'Enable internal housekeeping' => true,
'Data storage period' => '400d'
];
public $db_default_values = [
'auditlog_enabled' => 1,
'auditlog_mode' => 1,
'hk_audit_mode' => 1,
'hk_audit' => '31d'
];
/**
* Attach MessageBehavior to the test.
*
* @return array
*/
public function getBehaviors() {
return ['class' => CMessageBehavior::class];
}
/**
* The function's main purpose is to check if the layout of the page is not broken and fields are in their place,
* Additional checkups are made and committed within the function.
*/
public function testFormAdministrationAuditLog_CheckLayout() {
$this->page->login()->open('zabbix.php?action=audit.settings.edit')->waitUntilReady();
$form = $this->query('id:audit-settings')->waitUntilPresent()->asForm()->one();
$form->checkValue($this->default_values);