Source
$lld_original_steps = $this->getSteps('host_discovery.php?form=update&context='.$context.'&itemid='.$this->lldid);
<?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/CWebTest.php';
require_once dirname(__FILE__).'/../../include/helpers/CDataHelper.php';
require_once dirname(__FILE__).'/../behaviors/CMessageBehavior.php';
require_once dirname(__FILE__).'/../behaviors/CPreprocessingBehavior.php';
/**
* Common code for cloning hosts and templates with preprocessing steps in items.
*/
class testFormPreprocessingClone extends CWebTest {
/**
* Attach MessageBehavior and PreprocessingBehavior to the test.
*
* @return array
*/
public function getBehaviors() {
return [
CMessageBehavior::class,
CPreprocessingBehavior::class
];
}
public $hostid;
public $itemid;
public $lldid;
public $item_prototypeid;
const COMMON_PREPROCESSING = [
[
'type' => '5',
'params' => "regular expression pattern \ntest output",
'error_handler' => 2,
'error_handler_params' => 'value1'
],
[
'type' => '11',
'params' => '/document/item/value/text()',
'error_handler' => 0,
'error_handler_params' => ''
],
[
'type' => '12',
'params' => '$.document.item.value parameter.',
'error_handler' => 3,
'error_handler_params' => 'error1'
],
[
'type' => '15',
'params' => 'regular expression pattern for not matching',
'error_handler' => 0,
'error_handler_params' => ''
],
[
'type' => '16',
'params' => '/json/path',
'error_handler' => 0,
'error_handler_params' => ''
],
[
'type' => '17',
'params' => '/xml/path',
'error_handler' => 0,
'error_handler_params' => ''
],
[
'type' => '21',
'params' => 'test script',
'error_handler' => 0,
'error_handler_params' => ''
],
[
'type' => '24',
'params' => ".\n/\n1",
'error_handler' => 0,
'error_handler_params' => ''