Source
<?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/>.
**/
class WebScenarios {
const HOSTID = 40001;
/**
* Create data for web scenarios related tests.
*
* @return array
*/
public static function load() {
$host = 'Host for Web scenario testing';
$template = 'Template for web scenario testing';
$template_responce = CDataHelper::createTemplates([
[
'host' => $template,
'groups' => [
'groupid' => 1
]
]
]);
$templateid = $template_responce['templateids'][$template];
CDataHelper::call('host.update', [
[
'hostid' => self::HOSTID,
'templates' => [
'templateid' => $templateid
]
]
]);
CDataHelper::call('httptest.create', [
[
'name' => 'Scenario for Update',
'hostid' => self::HOSTID,
'agent' => 'Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; Trident/6.0)',
'steps' => [
[
'name' => 'step 1 of scenario 1',
'url' => 'http://zabbix.com',
'no' => 1
]
],
'tags' => [
[