Source
'Tag display priority' => ['value' => '', 'placeholder' => 'comma-separated list', 'enabled' => false, 'maxlength' => 2048],
<?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/CWebTest.php';
require_once dirname(__FILE__).'/../../include/helpers/CDataHelper.php';
require_once dirname(__FILE__).'/../behaviors/CMessageBehavior.php';
/**
* @backup config, widget
*
* @onBefore prepareDashboardData
*/
class testDashboardProblemsWidget extends CWebTest {
private static $dashboardid;
private static $update_widget = 'Problem widget for updating';
/**
* Attach MessageBehavior to the test.
*
* @return array
*/
public function getBehaviors() {
return [CMessageBehavior::class];
}
/**
* SQL query to get widget and widget_field tables to compare hash values, but without widget_fieldid
* because it can change.
*/
private $sql = 'SELECT wf.widgetid, wf.type, wf.name, wf.value_int, wf.value_str, wf.value_groupid, wf.value_hostid,'.
' wf.value_itemid, wf.value_graphid, wf.value_sysmapid, w.widgetid, w.dashboard_pageid, w.type, w.name, w.x, w.y,'.
' w.width, w.height'.
' FROM widget_field wf'.
' INNER JOIN widget w'.
' ON w.widgetid=wf.widgetid ORDER BY wf.widgetid, wf.name, wf.value_int, wf.value_str, wf.value_groupid,'.
' wf.value_itemid, wf.value_graphid, wf.value_hostid';
public function prepareDashboardData() {
$response = CDataHelper::call('dashboard.create', [
'name' => 'Problem widget dashboard',
'auto_start' => 0,
'pages' => [
[
'name' => 'First Page',
'display_period' => 3600,
'widgets' => [
[
'type' => 'problems',
'name' => 'Problem widget for updating',
'x' => 0,
'y' => 0,
'width' => 11,
'height' => 6,
'view_mode' => 0,
'fields' => [
['type' => 0, 'name' => 'severities', 'value' => 0],
['type' => 0, 'name' => 'severities', 'value' => 4],
['type' => 0, 'name' => 'severities', 'value' => 2],
['type' => 0, 'name' => 'evaltype', 'value' => 2],
['type' => 0, 'name' => 'rf_rate', 'value' => '900'],
['type' => 0, 'name' => 'show', 'value' => 3],
['type' => 0, 'name' => 'show_lines', 'value' => 12],
['type' => 0, 'name' => 'show_opdata', 'value' => 1],
['type' => 0, 'name' => 'show_suppressed', 'value' => 1],
['type' => 0, 'name' => 'show_tags', 'value' => 2],
['type' => 0, 'name' => 'sort_triggers', 'value' => 15],
['type' => 0, 'name' => 'show_timeline', 'value' => 0],
['type' => 0, 'name' => 'tag_name_format', 'value' => 1],
['type' => 0, 'name' => 'tags.0.operator', 'value' => 1],
['type' => 0, 'name' => 'tags.1.operator', 'value' => 1],
['type' => 0, 'name' => 'acknowledgement_status', 'value' => 1],
['type' => 1, 'name' => 'problem', 'value' => 'test2'],