Source
$id_3 = CDBHelper::getValue('SELECT druleid FROM drules WHERE name='.zbx_dbstr('Discovery rule for cancelling scenario'));
<?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.
**/
require_once dirname(__FILE__) . '/../../include/CWebTest.php';
/**
* @backup widget
*
* @onBefore prepareDiscoveryStatusWidgetData
*
* @dataSource NetworkDiscovery
*/
class testDashboardDiscoveryStatusWidget extends CWebTest {
/**
* Attach MessageBehavior and TableBehavior to the test.
*
* @return array
*/
public function getBehaviors() {
return [
CMessageBehavior::class,
CTableBehavior::class
];
}
/**
* Id of the dashboard with widgets.
*
* @var integer
*/
protected static $dashboardid;
protected static $druleids;
protected static $update_widget = 'Update widget';
const DISCOVERY_RULE_1 = 'A discovery rule to be displayed first';
const DISCOVERY_RULE_2 = 'Discovery rule with 0 discovered hosts';
const DISCOVERY_RULE_3 = 'Discovery rule with active discovered hosts';
const DISCOVERY_RULE_4 = 'Discovery rule with both type of hosts';
const DISCOVERY_RULE_5 = 'XYZ - discovery rule to be displayed last (Inactive hosts)';
const DELETE_WIDGET = 'Discovery status widget to delete';
const DATA_WIDGET = 'Widget for data check';
const CANCEL_WIDGET = 'Widget for testing cancel button';
/**