Source
$this->assertEquals($data['interfaces'][$interface_name]['color'], $interface->getCSSValue('background-color'));
<?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__).'/../../include/helpers/CDataHelper.php';
/**
* @backup hosts
* @onBefore prepareInterfacesData
*/
class testPageHostInterfaces extends CWebTest {
const RED = 'rgba(214, 78, 78, 1)';
const GREEN = 'rgba(52, 175, 103, 1)';
const ORANGE = 'rgba(241, 165, 11, 1)';
const GREY = 'rgba(235, 235, 235, 1)';
public static function prepareInterfacesData() {
$interfaces = [
[
'type' => 1,
'main' => 1,
'useip' => 0,
'ip' => '127.1.1.1',
'dns' => '1available.zabbix.com',
'port' => '10050',
'available' => 1
],
[
'type' => 1,
'main' => 0,
'useip' => 0,
'ip' => '127.1.1.2',
'dns' => '2available.zabbix.com',
'port' => '10051',
'available' => 1
],
[
'type' => 2,
'main' => 1,
'useip' => 1,
'ip' => '127.0.0.98',
'dns' => 'snmpv3zabbix.com',
'port' => '163',
'details' => [