Source
$this->assertEquals(1, CDBHelper::getCount($sql), "Chuck Norris: host $hostid activated but status is wrong in the DB");
<?php
/*
** 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 Affero General Public License as published by the Free Software Foundation, version 3.
**
** 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 Affero General Public License for more details.
**
** You should have received a copy of the GNU Affero General Public License along with this program.
** If not, see <https://www.gnu.org/licenses/>.
**/
require_once __DIR__.'/../../include/CLegacyWebTest.php';
require_once __DIR__.'/../behaviors/CMessageBehavior.php';
require_once __DIR__.'/../behaviors/CTableBehavior.php';
require_once __DIR__.'/../behaviors/CTagBehavior.php';
/**
* @dataSource TagFilter, Proxies, WebScenarios
*
* @backup hosts, httptest
*
* @onBefore prepareHostsData
*/
class testPageHosts extends CLegacyWebTest {
/**
* Attach MessageBehavior, TableBehavior and TagBehavior to the test.
*/
public function getBehaviors() {
return [
CMessageBehavior::class,
CTableBehavior::class,
CTagBehavior::class
];
}
public $HostName = 'ЗАББИКС Сервер';
public $HostGroup = 'Zabbix servers';
public $HostIp = '127.0.0.1';
public $HostPort = '10050';
public static function prepareHostsData() {
CDataHelper::createHosts([
[
'host' => 'Disabled status',
'status' => HOST_STATUS_NOT_MONITORED,
'groups' => [
'groupid' => '6'
]
],
[
'host' => 'Enabled status',
'status' => HOST_STATUS_MONITORED,
'groups' => [
'groupid' => '6'
]
]
]);
}