Skip to content

Commit 0707e47

Browse files
Update LDAP config
1 parent 85cfdd3 commit 0707e47

File tree

2 files changed

+24
-21
lines changed

2 files changed

+24
-21
lines changed

tests/AdvancedFormsTestCase.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -116,16 +116,16 @@ protected function setupAuthLdap(): AuthLDAP
116116
return $this->createItem(AuthLDAP::class, [
117117
'name' => 'openldap',
118118
'host' => 'openldap',
119-
'basedn' => 'dc=example,dc=org',
120-
'rootdn' => 'cn=admin,dc=example,dc=org',
121-
'port' => '1389',
119+
'basedn' => 'dc=glpi,dc=org',
120+
'rootdn' => 'cn=admin,dc=glpi,dc=org',
121+
'port' => '389',
122122
'condition' => '(objectClass=inetOrgPerson)',
123123
'login_field' => 'uid',
124124
'sync_field' => 'entryuuid',
125125
'use_tls' => 0,
126126
'use_dn' => 1,
127127
'is_active' => 1,
128-
'rootdn_passwd' => 'adminpassword',
128+
'rootdn_passwd' => 'admin',
129129
'use_bind' => 1,
130130
], ['rootdn_passwd']);
131131
}
@@ -149,7 +149,7 @@ protected function skipIfOpenldapIsNotSetup(): void
149149
{
150150
// Temporary code until openldap can be enabled on the ci container.
151151
$host = 'openldap';
152-
$port = 1389;
152+
$port = 389;
153153

154154
$connection = @fsockopen($host, $port, $errno, $errstr);
155155
if (!$connection) {

tests/Model/Dropdown/LdapDropdownTest.php

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -44,58 +44,61 @@ final class LdapDropdownTest extends AdvancedFormsTestCase
4444
{
4545
public static function provideLdapFilters(): iterable
4646
{
47-
yield 'search for user01' => [
48-
'search_text' => '01',
47+
yield 'search for brazil159' => [
48+
'search_text' => 'brazil159',
4949
'page' => 1,
5050
'page_limit' => 20,
5151
'expected' => [
5252
'results' => [
53-
['id' => 'user01', 'text' => 'user01'],
53+
['id' => 'brazil159', 'text' => 'brazil159'],
5454
],
5555
'count' => 1,
5656
],
5757
];
58-
yield 'search for user02' => [
59-
'search_text' => '02',
58+
yield 'search for ecuador248' => [
59+
'search_text' => 'ecuador248',
6060
'page' => 1,
6161
'page_limit' => 20,
6262
'expected' => [
6363
'results' => [
64-
['id' => 'user02', 'text' => 'user02'],
64+
['id' => 'ecuador248', 'text' => 'ecuador248'],
6565
],
6666
'count' => 1,
6767
],
6868
];
6969
yield 'search for all users' => [
7070
'search_text' => '',
7171
'page' => 1,
72-
'page_limit' => 20,
72+
'page_limit' => 5,
7373
'expected' => [
7474
'results' => [
75-
['id' => 'user01', 'text' => 'user01'],
76-
['id' => 'user02', 'text' => 'user02'],
75+
['id' => 'michel', 'text' => 'michel'],
76+
['id' => 'pierre', 'text' => 'pierre'],
77+
['id' => 'remi', 'text' => 'remi'],
78+
['id' => 'specialchar1', 'text' => 'specialchar1'],
79+
['id' => 'specialchar2', 'text' => 'specialchar2'],
7780
],
78-
'count' => 2,
81+
'count' => 5,
7982
],
8083
];
81-
yield 'search for all users, with pagination (page 1)' => [
82-
'search_text' => '',
84+
yield 'search with pagination (page 1)' => [
85+
'search_text' => 'brazil',
8386
'page' => 1,
8487
'page_limit' => 1,
8588
'expected' => [
8689
'results' => [
87-
['id' => 'user01', 'text' => 'user01'],
90+
['id' => 'brazil0', 'text' => 'brazil0'],
8891
],
8992
'count' => 1,
9093
],
9194
];
92-
yield 'search for all users, with pagination (page 2)' => [
93-
'search_text' => '',
95+
yield 'search with pagination (page 2)' => [
96+
'search_text' => 'brazil',
9497
'page' => 2,
9598
'page_limit' => 1,
9699
'expected' => [
97100
'results' => [
98-
['id' => 'user02', 'text' => 'user02'],
101+
['id' => 'brazil1', 'text' => 'brazil1'],
99102
],
100103
'count' => 1,
101104
],

0 commit comments

Comments
 (0)