Source
['name' => '!@#$%^&*()_+-=[]{};:"|,./<>?Ž©µÆ', 'description' => '!@#$%^&*()_+-=[]{};:"|,./<>?Ž©µÆ', 'provision_status' => 1]
<?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 dirname(__FILE__).'/../behaviors/CMessageBehavior.php';
require_once dirname(__FILE__).'/../behaviors/CTableBehavior.php';
require_once dirname(__FILE__).'/../../include/helpers/CDataHelper.php';
require_once dirname(__FILE__).'/../common/testFormAuthentication.php';
/**
* @backup config, userdirectory, usrgrp
*
* @dataSource LoginUsers
*/
class testUsersAuthenticationLdap extends testFormAuthentication {
/**
* Attach MessageBehavior and TableBehavior to the test.
*
* @return array
*/
public function getBehaviors() {
return [
CMessageBehavior::class,
CTableBehavior::class
];
}
public function testUsersAuthenticationLdap_Layout() {
$ldap_form = $this->openFormAndCheckBasics('LDAP');
// Check LDAP form default values.
$ldap_form->checkValue([
'Enable LDAP authentication' => false,
'Enable JIT provisioning' => false,
'Case-sensitive login' => true,
'Provisioning period' => '1h'
]);
// Check LDAP form fields editability.
foreach ([false, true] as $status) {
$ldap_form->fill(['Enable LDAP authentication' => $status]);
foreach (['Enable JIT provisioning', 'Servers', 'Case-sensitive login'] as $label) {
$this->assertTrue($ldap_form->getField($label)->isEnabled($status));
}
}
$this->assertEquals(['Servers'], $ldap_form->getRequiredLabels());
// Check server table's headers.