Source
xxxxxxxxxx
<?php
/*
** Zabbix
** 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 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.
**/
class WebScenarios {
const HOSTID = 40001;
/**
* Create data for web scenarios related tests.
*
* @return array
*/
public static function load() {
$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