Source
$this->assertEquals(CTestArrayHelper::get($data, 'parent_rootcause', ''), $row->getColumn('Root cause')->getText());
<?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';
/**
* @dataSource EntitiesTags, Services, Actions
*
* @backup services
*/
class testPageServicesServices extends CWebTest {
/**
* Attach MessageBehavior and TableBehavior to the test.
*
* @return array
*/
public function getBehaviors() {
return [
CMessageBehavior::class,
CTableBehavior::class
];
}
const EDIT = true;
const SERVICE_COUNT = 20;
const LAYOUT_PARENT = 'Parent for 2 levels of child services';
const LAYOUT_CHILD = 'Child service with child service';
const LAYOUT_CHILD2 = 'Child service of child service';
const ROOTCAUSE_PARENT = 'Test order';
const ROOTCAUSE_CHILD1 = '1';
const ROOTCAUSE_CHILD2 = '2';
const ROOTCAUSE_CHILD3 = '3';
const BREADCRUMB_SELECTOR = 'xpath://ul[@class="breadcrumbs"]';
const TABLE_SELECTOR = 'id:service-list';
/**
* Set parent and child services to Problem status and link the child services to the corresponding problem events.
*/
public static function prepareServiceProblemsData() {
// Statuses: Warning = 2, Average = 3, High = 4.
$service_statuses = [
self::ROOTCAUSE_PARENT => 4,
self::ROOTCAUSE_CHILD1 => 2,