Source
$this->page->login()->open('zabbix.php?action=item.list&context=host&filter_set=1&filter_hostids%5B0%5D='.self::HOST_ID);
<?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/items.inc.php';
require_once dirname(__FILE__).'/../behaviors/CPreprocessingBehavior.php';
/**
* @backup items
*
* @dataSource GlobalMacros
*/
class testFormPreprocessingTest extends CWebTest {
/**
* Attach PreprocessingBehavior to the test.
*
* @return array
*/
public function getBehaviors() {
return [CPreprocessingBehavior::class];
}
const HOST_ID = 40001; //'Simple form test host'
private static $key;
private static $name;
public $change_types = [
'Discard unchanged with heartbeat',
'Simple change',
'Change per second',
'Discard unchanged'
];
public static function getTestSingleStepData() {
return [
[
[
'expected' => TEST_GOOD,
'preprocessing' => [
['type' => 'Replace', 'parameter_1' => 'текст', 'parameter_2' => 'замена'],
['type' => 'Regular expression', 'parameter_1' => 'expression', 'parameter_2' => 'test output'],
['type' => 'Trim', 'parameter_1' => '1a2b3c'],
['type' => 'Right trim', 'parameter_1' => 'abc'],
['type' => 'Left trim', 'parameter_1' => 'def'],
['type' => 'XML XPath', 'parameter_1' => 'path'],
['type' => 'JSONPath', 'parameter_1' => 'path'],
['type' => 'CSV to JSON','parameter_1' => ' ', 'parameter_2' => '\\', 'parameter_3' => true],
['type' => 'XML to JSON'],