Source
$template_sql = 'SELECT NULL FROM hosts WHERE LOWER(host) LIKE '.zbx_dbstr('%'.$data['search_string'].'%').' AND status=3';
<?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.
**/
use Facebook\WebDriver\Exception\TimeoutException;
require_once dirname(__FILE__).'/../include/CWebTest.php';
require_once dirname(__FILE__).'/behaviors/CTableBehavior.php';
/**
* @backup hstgrp
*
* @onBefore prepareData
*/
class testPageSearch extends CWebTest {
/**
* Attach TableBehavior to the test.
*
* @return array
*/
public function getBehaviors() {
return [CTableBehavior::class];
}
protected $search_string = 'Test object';
protected static $widgets = [
'hosts' => [
'key' => 'hosts',
'selector' => 'id:search_hosts_widget',
'table_selector' => "xpath://div[@id='search_hosts_widget']//table",
'title' => 'Hosts',
'column_groups' => ['Host', 'IP', 'DNS', 'Monitoring', 'Configuration'],
'columns' => [
['text' => 'Test object Host', 'href' => 'zabbix.php?action=host.edit&hostid={id}'],
['text' => '127.0.0.1'],
['text' => 'testdnstwo.example.com'],
['text' => 'Latest data', 'href' => 'zabbix.php?action=latest.view&hostids%5B%5D={id}&filter_set=1'],
['text' => 'Problems', 'href' => 'zabbix.php?action=problem.view&hostids%5B0%5D={id}&filter_set=1'],
['text' => 'Graphs', 'href' => 'zabbix.php?action=charts.view&filter_hostids%5B0%5D={id}&filter_set=1'],
['text' => 'Dashboards', 'href' => 'zabbix.php?action=host.dashboard.view&hostid={id}'],
['text' => 'Web', 'href' => 'zabbix.php?action=web.view&filter_hostids%5B%5D={id}&filter_set=1'],
['text' => 'Items', 'href' => 'items.php?filter_set=1&filter_hostids%5B0%5D={id}&context=host'],
['text' => 'Triggers', 'href' => 'triggers.php?filter_set=1&filter_hostids%5B0%5D={id}&context=host'],
['text' => 'Graphs', 'href' => 'graphs.php?filter_set=1&filter_hostids%5B0%5D={id}&context=host'],