0 or {$MACRO: "context"} or {#MACRO} or {TRIGGER.VALUE} or'. ' func(/host/item) or func(/host2/item2)', 'host', 'Zabbix server', '5 + func(/Zabbix server/item) <> 0 or {$MACRO: "context"} or {#MACRO} or {TRIGGER.VALUE} or'. ' func(/Zabbix server/item) or func(/host2/item2)' ], [ '5 + func(/host/item) <> 0 or {$MACRO: "context"} or'. ' {{#MACRO}.regsub("^([0-9]+)", "{#MACRO}: \1")} or {TRIGGER.VALUE} or'. ' func(/host/item) or func(/host2/item2)', 'host', 'Zabbix server', '5 + func(/Zabbix server/item) <> 0 or {$MACRO: "context"} or'. ' {{#MACRO}.regsub("^([0-9]+)", "{#MACRO}: \1")} or {TRIGGER.VALUE} or'. ' func(/Zabbix server/item) or func(/host2/item2)' ], [ 'func(/host/item) or {{#M}.regsub("func(/host/item)", "\1")}', 'host', 'Zabbix server', 'func(/Zabbix server/item) or {{#M}.regsub("func(/host/item)", "\1")}' ], [ '5 + func(/Zabbix server/item) <> 0 or func(/Zabbix server/item) or func(/host2/item2)', 'Zabbix server', 'host', '5 + func(/host/item) <> 0 or func(/host/item) or func(/host2/item2)' ], [ 'min(func(/host/item), func(/host/item), "func(/host/item)") = "func(/host/item)"', 'host', 'Zabbix server', 'min(func(/Zabbix server/item), func(/Zabbix server/item), "func(/host/item)") = "func(/host/item)"' ] ]; } /** * @dataProvider dataProvider * * @param string $source * @param string $expected */ public function testExpressionWithReplacedHost($source, $src_host, $dst_host, $expected) { $this->assertSame( $expected, CTriggerGeneralHelper::getExpressionWithReplacedHost($source, $src_host, $dst_host) ); } }