Source
$this->checkSubmittedOverlay($data['expected'], $override_overlay, CTestArrayHelper::get($override, 'error'));
<?php
/*
** Zabbix
** Copyright (C) 2001-2023 Zabbix SIA
**
** This program is free software; you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation; either version 2 of the License, or
** (at your option) any later version.
**
** 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 General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program; if not, write to the Free Software
** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
**/
require_once dirname(__FILE__).'/../../include/CWebTest.php';
require_once dirname(__FILE__).'/../behaviors/CMessageBehavior.php';
/**
* @backup items, ids
*/
class testFormLowLevelDiscoveryOverrides extends CWebTest {
const HOST_ID = 40001;
const UPDATED_ID = 133800;
const INTERVAL_MAPPING = [
'Type' => [
'name' => 'type',
'class' => 'CSegmentedRadioElement',
'selector' => 'xpath:./ul[contains(@class, "radio-list-control")]'.
'|./ul/li/ul[contains(@class, "radio-list-control")]|./div/ul[contains(@class, "radio-list-control")]'
],
'Interval' => [
'name' => 'delay',
'class' => 'CElement',
'selector' => 'xpath:./input[@name][not(@type) or @type="text" or @type="password"][not(@style) or '.
'not(contains(@style,"display: none"))]|./textarea[@name]'
],
'Period' => [
'name' => 'period',
'class' => 'CElement',
'selector' => 'xpath:./input[@name][not(@type) or @type="text" or @type="password"][not(@style) or '.
'not(contains(@style,"display: none"))]|./textarea[@name]'
]
];
public static $created_id;
public static $old_hash;
/**
* Attach Behaviors to the test.
*
* @return array
*/
public function getBehaviors() {
return ['class' => CMessageBehavior::class];
}
/*
* Overrides data for LLD creation.
*/
public static function getCreateData() {
return [
// #0.
[
[
'expected' => TEST_BAD,
'overrides' => [
[
'fields' => [
'Name' => ''
],
'error' => 'Incorrect value for field "Name": cannot be empty.'
]
]
]
],
// #1.
[
[
'expected' => TEST_BAD,
'overrides' => [
[
'fields' => [