Source
$this->assertEquals(self::DRULE_LIFETIME_DELETE_DISABLED.'_t_'.self::LLD_DATA_MACRO_VALUE, $trigger['description']);
<?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__).'/../include/CIntegrationTest.php';
/**
* Test suite for low level discovery (LLD).
*
* @required-components server
* @backup items,hosts,triggers,graphs,hstgrp
*/
class testLowLevelDiscovery extends CIntegrationTest {
const TEMPLATE_NAME_PRE = 'template';
const NUMBER_OF_TEMPLATES = 2;
const DRULE_LIFETIME_DEFAULT = '1_drule_default';
const DRULE_LIFETIME_NEVER = '2_drule_never';
const DRULE_LIFETIME_DELETE = '3_drule_delete';
const DRULE_LIFETIME_DISABLE_AFTER = '4_drule_disable_after';
const DRULE_LIFETIME_DELETE_DISABLED = '5_drule_test_delete_disabled';
const HOSTNAME_LIFETIME = 'lifetime';
const LLD_DATA_MACRO = '{#DISC.ID}';
const LLD_DATA_MACRO_VALUE = '01';
private static $hostid;
private static $lifetime_hostid;
private static $ruleid;
private static $disable_itemid;
private static $disable_triggerid;
private static $disable_hostid;
private static $delete_disabled_itemid;
private static $delete_disabled_triggerid;
private static $delete_disabled_hostid;
/**
* @inheritdoc
*/
public function prepareData() {
// Create hosts "discovery" and "lifetime".
$response = $this->call('host.create', [
[
'host' => 'discovery',
'interfaces' => [
[
'type' => 1,
'main' => 1,
'useip' => 1,
'ip' => '127.0.0.1',
'dns' => '',