Source
$this->page->login()->open(($source === 'hosts') ? 'zabbix.php?action=host.list' : 'zabbix.php?action=template.list')->waitUntilReady();
<?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__).'/../behaviors/CMessageBehavior.php';
require_once dirname(__FILE__).'/../behaviors/CTableBehavior.php';
require_once dirname(__FILE__).'/../../include/helpers/CDataHelper.php';
/**
* Base class for Value mappings function tests.
*/
class testFormValueMappings extends CWebTest {
/**
* Attach MessageBehavior and TableBehavior to the test.
*
* @return array
*/
public function getBehaviors() {
return [
CMessageBehavior::class,
CTableBehavior::class
];
}
const HOSTID = 99134; // ID of the host for valuemap update.
const TEMPLATEID = 40000; // ID of the template for valuemap update.
const UPDATE_VALUEMAP1 = 'Valuemap for update 1';
const UPDATE_VALUEMAP2 = 'Valuemap for update 2';
const DELETE_VALUEMAP = 'Valuemap for delete';
const EXISTING_VALUEMAPS = [
[
'Name' => 'Valuemap for delete',
'Value' => "=1010101010101010101010101010101\n⇒\ndefault value1010101010101010101010101010101".
"\n424242424242424242424242424242424242424242424242\n⇒\nAnswer to the Ultimate Question of Life, ".
"Universe and Everything\n123458945-987653341\n⇒\nfrom 123458945 to 987653341\n…",
'Action' => 'Remove'
],
[
'Name' => 'Valuemap for update 1',
'Value' => "=\n⇒\nreference newvalue",
'Action' => 'Remove'
],
[
'Name' => 'Valuemap for update 2',
'Value' => "=\n⇒\nno data\n=1\n⇒\none\n=2\n⇒\ntwo\n…",
'Action' => 'Remove'
]
];
private static $previous_valuemap_name = self::UPDATE_VALUEMAP1;