Source
$this->assertMessage(TEST_BAD, 'Access denied', 'You are logged in as "Admin". You have no permissions to access this page.');
<?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.
**/
require_once dirname(__FILE__) . '/../include/CWebTest.php';
require_once dirname(__FILE__).'/behaviors/CMessageBehavior.php';
require_once dirname(__FILE__).'/../include/helpers/CDataHelper.php';
/**
* @backup token
*
* @dataSource ScheduledReports
*
* @onBefore prepareData
*/
class testSID extends CWebTest {
/**
* Token ID used for update.
*
* @var string
*/
protected static $token_id;
public function prepareData() {
$response = CDataHelper::call('token.create', [
'name' => 'api_update',
'userid' => '1'
]);
$this->assertArrayHasKey('tokenids', $response);
self::$token_id = $response['tokenids'][0];
// Create event correlation.
CDataHelper::call('correlation.create', [
[
'name' => 'Event correlation for element remove',
'filter' => [
'evaltype' => 0,
'conditions' => [
[
'type' => ZBX_CORR_CONDITION_OLD_EVENT_TAG,
'tag' => 'element remove'
]
]
],
'operations' => [
[