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/>.
**/
require_once dirname(__FILE__).'/../../include/CWebTest.php';
require_once dirname(__FILE__).'/../behaviors/CMessageBehavior.php';
/**
* @dataSource WebScenarios
*
* @onBefore getContextData
*
* @backup httptest
*/
class testFormWebScenario extends CWebTest {
protected static $templateid;
protected static $template_name;
protected static $template_scenarioid;
protected static $delete_scenarioid;
protected static $update_scenario = 'Scenario for Update';
const HOSTID = 40001;
const TEMPLATE_SCENARIO = 'Template_Web_scenario';
const DELETE_SCENARIO = 'Scenario for Delete';
const SQL = 'SELECT * FROM httptest h LEFT JOIN httptest_field hf ON hf.httptestid = h.httptestid ORDER BY h.httptestid, hf.httptest_fieldid';
const CLONE_SCENARIO = 'Scenario for Clone';
protected static $all_fields = [
'scenario_fields' => [
'Name' => 'All fields specified',
'Update interval' => '6h',
'Attempts' => 7,
'Agent' => 'other ...',
'User agent string' => 'My super puper agent string 良い一日を',
'HTTP proxy' => '良い一日を',
'Enabled' => false
],
'auth_fields' => [
'HTTP authentication' => 'Basic',
'User' => '!@#$%^&*()_+=-良い一日を',
'Password' => '!@#$%^&*()_+=-良い一日を',
'SSL verify peer' => true,
'SSL verify host' => true,
'SSL certificate file' => '!@#$%^&*()_+=-良い一日を',
'SSL key file' => '!@#$%^&*()_+=-良い一日を',
'SSL key password' => '!@#$%^&*()_+=-良い一日を'
],
'variables' => [
[
'action' => USER_ACTION_UPDATE,
'index' => 0,
'name' => '{!@#$%^&*()_+=-良い一日を}',
'value' => '!@#$%^&*()_+=-良い一日を'
],
[
'name' => '{xyz}',
'value' => ''
]
],
'headers' => [
[
'action' => USER_ACTION_UPDATE,
'index' => 0,
'name' => 'OneTwoThree',
'value' => ''
],
[
'name' => '!@#$%^&*()_+=-良い一日を',
'value' => '!@#$%^&*()_+=-良い一日を'
]
],
'tags' => [
[
'action' => USER_ACTION_UPDATE,
'index' => 0,
'tag' => 'tag',
'value' => 'value'
],