Source
* Additional complexity comes from the Status column, as the displayed values there are calculated on the fly.
<?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/CTableBehavior.php';
/**
* @backup hosts
*
* @onBefore prepareData
*/
class testPageMonitoringWebDetails extends CWebTest {
/**
* Attach TableBehavior to the test.
*
* @return array
*/
public function getBehaviors() {
return [CTableBehavior::class];
}
protected static $host_id;
protected static $httptest_id;
public function prepareData() {
$response = CDataHelper::createHosts([
[
'host' => 'Host for web scenarios',
'groups' => [
'groupid' => 6
]
]
]);
self::$host_id = $response['hostids']['Host for web scenarios'];
$response = CDataHelper::call('httptest.create', [
[
'name' => 'Layout',
'hostid' => self::$host_id,
'steps' => [
[
'name' => 'Step 1',
'url' => 'http://example.com',
'no' => 1
]
]
]
]);
self::$httptest_id = $response['httptestids'][0];