Source
// TODO: Uncomment the test cases after issue in ZBX-24652 is fixed. Update the numbering of all test cases.
<?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';
/**
* @backup sysmaps
*
* @onBefore prepareMapsData
*
* @dataSource WidgetCommunication
*/
class testPageMaps extends CWebTest {
/**
* Attach MessageBehavior and TableBehavior to the test.
*
* @return array
*/
public function getBehaviors() {
return [
CMessageBehavior::class,
CTableBehavior::class
];
}
const SYSMAPS_SQL = 'SELECT * FROM sysmaps ORDER BY sysmapid';
const SYSMAP_NAME_LOW_NUMBER = '999 for sorting test';
const SYSMAP_NAME_HIGH_NUMBER = '1111 for sorting test';
const SYSMAP_NAME_WITH_SYMBOLS = 'Name with 3/4-byte symbols: 🤖 ⃠ Ω⌚Ԏ﨧';
const SYSMAP_TO_DELETE = 'Sysmap for deletion';
const SYSMAP_FIRST_A = 'A map to check alphabetical sorting';
const SYSMAP_FIRST_Z = 'Zabbix sysmap for checking alphabetical sorting';
const SYSMAP_LOW_WIDTH = 'Map with lowest width';
const SYSMAP_HIGH_WIDTH = 'Map with highest width';
const SYSMAP_LOW_HEIGHT = 'Map with lowest height';
const SYSMAP_HIGH_HEIGHT = 'Map with highest height';
const SYSMAP_SPACES_NAME = 'Map to check that there is no trim for spaces';
protected static $sysmapids;
public function prepareMapsData() {
CDataHelper::call('map.create', [
[
'name' => self::SYSMAP_NAME_LOW_NUMBER,
'width' => 600,
'height' => 600
],
[
'name' => self::SYSMAP_NAME_HIGH_NUMBER,
'width' => 600,
'height' => 600
],
[
'name' => self::SYSMAP_NAME_WITH_SYMBOLS,
'width' => 600,
'height' => 600
],
[
'name' => self::SYSMAP_TO_DELETE,
'width' => 600,
'height' => 600
],
[
'name' => self::SYSMAP_FIRST_A,
'width' => 600,
'height' => 600
],
[
'name' => self::SYSMAP_FIRST_Z,
'width' => 600,
'height' => 600
],
[
'name' => self::SYSMAP_LOW_WIDTH,
'width' => 10,
'height' => 600