Source
$this->assertEquals('If HTTP authentication is enabled, all users (even with frontend access set to LDAP/Internal)'.
<?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/CLegacyWebTest.php';
/**
* @onBefore removeGuestFromDisabledGroup
* @onAfter addGuestToDisabledGroup
* @dataSource LoginUsers
*/
class testFormAdministrationAuthenticationHttp extends CLegacyWebTest {
const LOGIN_GUEST = 1;
const LOGIN_USER = 2;
const LOGIN_HTTP = 3;
public function testFormAdministrationAuthenticationHttp_Layout() {
$this->page->login()->open('zabbix.php?action=authentication.edit');
$form = $this->query('name:form_auth')->asForm()->one();
$form->selectTab('HTTP settings');
// Check default values.
$default_values = [
'Enable HTTP authentication' => false,
'Default login form' => 'Zabbix login form',
'Remove domain name' => '',
'Case-sensitive login' => true
];
$form->checkValue($default_values);
// Check disabled fields.
$fields = ['Default login form', 'Remove domain name', 'Case-sensitive login'];
foreach ($fields as $field) {
$this->assertTrue($form->getField($field)->isEnabled(false));
}
// Check dropdown options.
$this->assertEquals(['Zabbix login form', 'HTTP login form'], $form->getField('Default login form')
->getOptions()->asText());
// Check input field maxlength.
$this->assertEquals('2048', $form->getField('Remove domain name')->getAttribute('maxlength'));
// Check hintbox.
$form->getLabel('Enable HTTP authentication')->query('class:icon-help-hint')->one()->click();