Source
$this->assertEquals($data['userdb_lang'], CDBHelper::getValue('SELECT lang FROM users WHERE username='.zbx_dbstr('user-zabbix')));
<?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/CWebTest.php';
require_once dirname(__FILE__).'/behaviors/CMessageBehavior.php';
/**
* @backup users
*
* @backup config
*/
class testLanguage extends CWebTest {
private const INFO = 'You are not able to choose some of the languages, because'.
' locales for them are not installed on the web server.';
private const INFO_RUS = 'Вы не можете выбрать некоторые языки, т.к. локали для'.
' них не установлены на вашем веб-сервере.';
private const WARNING_TITLE = 'You are not logged in';
private const WARNING_TITLE_RUS = 'Вы не выполнили вход';
/**
* Attach MessageBehavior to the test.
*
* @return array
*/
public function getBehaviors() {
return [CMessageBehavior::class];
}
public static function getGuiData() {
return [
[
[
'field' => [
'Default language' => 'Russian (ru_RU)'
],
'message' => 'Configuration updated',
'page_title' => 'Настройка веб-интерфейса',
'html_lang' => 'ru',
'defaultdb_lang' => 'ru_RU',
'info' => self::INFO_RUS,
'login_info' => [
'name' => 'Имя пользователя',
'password' => 'Пароль'
]
]