Source
'macro' => '{$SUSPENDISSE_CONDIMENTUM_VELIT_EU_SAPIENAPELLENTESQUEFPRETIUMTVELHACAAUGUEU_FFUSCE_ET_ANTE_IN_SEM_PHARETRA_PRETIUMMMMAURIS_DAPIBUS_FERMENTUM_URNA_SSCELERISQUE_ACCUMSAN_NULL_GCOMMODO_SIT_AMET_NNULLA_DAPIBUS_ID_PURUS_VITAE_MOLLIS_UPROIN_ET_SAPIEN_ET_TELLUS1}',
<?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/CAPITest.php';
/**
* @backup globalmacro
* @backup hostmacro
*/
class testUserMacro extends CAPITest {
public static function hostmacro_create() {
return [
[
'hostmacro' => [
'macro' => '{$ADD_1}',
'value' => 'test',
'type' => '0',
'hostid' => '90020',
'description' => 'text'
],
'expected_error' => null
],
[
'hostmacro' => [
[
'macro' => '{$MACRO}',
'value' => '',
'hostid' => 90020
],
[
'macro' => '{$MACRO}',
'value' => '',
'hostid' => 90020
]
],
'expected_error' => 'Invalid parameter "/2": value (hostid, macro)=(90020, {$MACRO}) already exists.'
],
[
'hostmacro' => [
[
'macro' => '{$MACRO: /var}',
'value' => '',
'hostid' => 90020
],