Source
$this->assertEquals(['Expand single problem', 'Number of problems', 'Number of problems and expand most critical one'],
<?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 __DIR__.'/../../include/CWebTest.php';
require_once __DIR__.'/../behaviors/CMessageBehavior.php';
require_once __DIR__.'/../behaviors/CTableBehavior.php';
/**
* @backup sysmaps
*
* @onBefore prepareMapsData
*/
class testFormMapProperties extends CWebTest {
/**
* Attach MessageBehavior and TableBehavior to the test.
*
* @return array
*/
public function getBehaviors() {
return [
CMessageBehavior::class,
CTableBehavior::class
];
}
protected static $map_update = 'Map for update test';
const MAP_UPDATE = 'Map for simple update and update test';
const MAP_CLONE_DELETE = 'Map for clone and delete test';
const HASH_SQL = 'SELECT * FROM sysmaps ORDER BY sysmapid';
const ICON_MAPPING = 'Icon mapping for map properties';
const XSS_EXAMPLE = '<script>alert(\'XSS\');</script>';
const BACKGROUND_IMAGE = 'Background image for map properties';
public function prepareMapsData() {
CDataHelper::call('iconmap.create', [
[
'name' => self::ICON_MAPPING,
'default_iconid' => 2,
'mappings' => [
[
'inventory_link' => 1,
'expression' => 'server',
'iconid' => 3
],
[
'inventory_link' => 1,
'expression' => 'test',
'iconid' => 4
]