Source
$cloned_form->getFieldContainer('Interfaces')->asHostInterfaceElement(['names' => $container_names])->checkValue($original_interfaces);
<?php
/*
** Zabbix
** Copyright (C) 2001-2022 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';
require_once dirname(__FILE__).'/../include/helpers/CDataHelper.php';
/**
* @backup hosts
* @onBefore prepareUpdateData
*/
class testFormHost extends CWebTest {
/**
* SQL query to get host and host interfaces tables to compare hash values.
*/
private $hosts_sql = 'SELECT * FROM hosts h INNER JOIN interface i ON h.hostid=i.hostid ORDER BY h.hostid, i.interfaceid';
/**
* SQL query to get snmp interface table to compare hash values.
*/
private $interface_snmp_sql = 'SELECT * FROM interface_snmp ORDER BY interfaceid, community';
/**
* Ids of the hosts that are created within this test specifically for the update scenario.
*
* @var array
*/
protected static $hostids;
/**
* Ids of the items that are created within this test.
*
* @var array
*/
protected static $itemids;
/**
* Default values of interfaces.
*
* @var array
*/
private $default_values = [
'Agent' => [
'ip' => '127.0.0.1',
'dns' => '',
'Connect to' => 'IP',
'port' => '10050'
],
'SNMP' => [
'ip' => '127.0.0.1',
'dns' => '',
'Connect to' => 'IP',
'port' => '161',
'SNMP version' => 'SNMPv2',
'SNMP community' => '{$SNMP_COMMUNITY}',
'Use bulk requests' => true
],
'JMX' => [
'ip' => '127.0.0.1',
'dns' => '',
'Connect to' => 'IP',
'port' => '12345'
],
'IPMI' => [
'ip' => '127.0.0.1',
'dns' => '',
'Connect to' => 'IP',
'port' => '623'
]
];
/**
* Attach Behaviors to the test.