Source
'value' => $itemids['Test Item history'] // item name in widget 'Simple host with item for Item history widget: Test Item history'.
<?php
/*
** Copyright (C) 2001-2024 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__).'/../../include/CWebTest.php';
require_once dirname(__FILE__).'/../behaviors/CMessageBehavior.php';
require_once dirname(__FILE__).'/../behaviors/CTableBehavior.php';
require_once dirname(__FILE__).'/../common/testWidgets.php';
/**
* @backup dashboard
*
* @onBefore prepareData
*
* @dataSource AllItemValueTypes
*/
class testDashboardItemHistoryWidget extends testWidgets {
/**
* Attach MessageBehavior and TableBehavior to the test.
*
* @return array
*/
public function getBehaviors() {
return [
CMessageBehavior::class,
CTableBehavior::class
];
}
const DEFAULT_WIDGET = 'Default Item history Widget';
const DELETE_WIDGET = 'Widget for delete';
const DATA_WIDGET = 'Widget for data check';
protected static $dashboardid;
protected static $dashboard_create;
protected static $dashboard_data;
protected static $update_widget = 'Update Item history Widget';
public static function prepareData() {
// Create host for widget header and data tests.
CDataHelper::createHosts([
[
'host' => 'Simple host with item for Item history widget',
'interfaces' => [
[
'type' => INTERFACE_TYPE_AGENT,
'main' => INTERFACE_PRIMARY,
'useip' => INTERFACE_USE_IP,
'ip' => '127.0.9.1',
'dns' => '',