Source
], 'Cannot link template "test-template-trigger-dependency-02" without template "test-template-trigger-dependency-01" to template "test-template-trigger-dependency-05" due to dependency of trigger "trigger-02".');
<?php
/*
** Zabbix
** Copyright (C) 2001-2022 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/CAPITest.php';
/**
* @backup hstgrp
* @backup hosts
*/
class testTemplate extends CAPITest {
public static function dataProviderCreate() {
return [
[
'request' => [
'host' => 'test-template-01',
'groups' => ['groupid' => 1]
]
],
[
'request' => [
'host' => 'test-template-02',
'groups' => []
],
'expected_error' => 'Invalid parameter "/1/groups": cannot be empty.'
],
[
'request' => [
'host' => 'test-template-03',
'groups' => [[]]
],
'expected_error' => 'Invalid parameter "/1/groups/1": the parameter "groupid" is missing.'
],
[
'request' => [
'host' => 'test-template-04',
'groups' => ['groupid' => 9999]
],
'expected_error' => 'No permissions to referred object or it does not exist!'
],
[
'request' => [
'host' => 'test-template-05',
'groups' => ['groupid' => 1]
],