Source
// TODO: temporarily commented out due webdriver issue, alert is not displayed while leaving page during test execution
<?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/helpers/CDataHelper.php';
/**
* Test for checking Proxy host form.
*
* @dataSource Proxies
*
* @onBefore prepareProxyData
*
* @backup proxy
*/
class testFormAdministrationProxies extends CWebTest {
private $sql = 'SELECT * FROM proxy ORDER BY proxyid';
protected static $update_proxy = 'Active proxy for update';
const CHANGE_ACTIVE_PROXY = 'Active proxy for refresh cancel simple update';
const CHANGE_PASSIVE_PROXY = 'Passive proxy for refresh cancel simple update';
const DELETE_PROXY_WITH_HOSTS = 'Proxy_2 for filter';
const DELETE_PROXY_WITH_DISCOVERY_RULE = 'Delete Proxy used in Network discovery rule';
/**
* Attach MessageBehavior to the test.
*
* @return array
*/
public function getBehaviors() {
return [CMessageBehavior::class];
}
/**
* Function used to create proxies.
*/
public function prepareProxyData() {
CDataHelper::call('proxy.create', [
[
'name' => self::$update_proxy,
'operating_mode' => PROXY_OPERATING_MODE_ACTIVE,
'description' => 'Description for update',
'tls_connect' => 1,
'tls_accept'=> 1
],
[
'name' => self::CHANGE_ACTIVE_PROXY,
'operating_mode' => PROXY_OPERATING_MODE_ACTIVE,
'description' => 'Active description for refresh',