@@ -74,26 +74,6 @@ my @ipTests = (
74
74
},
75
75
);
76
76
77
- my @ldapTests = (
78
- {
79
- dn => ' uid=Byron Hadley,o=shawshank' ,
80
- comment => ' bad dn for group' ,
81
- expect => 0,
82
- },
83
- {
84
- dn => ' uid=Andy Dufresne,o=shawshank' ,
85
- comment => ' good dn for group' ,
86
- expect => 1,
87
- },
88
- {
89
- dn => ' uid=Bogs Diamond,o=shawshank' ,
90
- comment => ' another good dn for group' ,
91
- expect => 1,
92
- },
93
- );
94
-
95
-
96
- plan tests => (173 + (scalar (@scratchTests ) * 2) + scalar (@ipTests )); # increment this value for each test you create
97
77
98
78
my $session = WebGUI::Test-> session;
99
79
my $testCache = WebGUI::Cache-> new($session , ' myTestKey' );
@@ -180,61 +160,6 @@ my $getGroupsIn = $optionGroup->getGroupsIn();
180
160
cmp_deeply($getGroupsIn , [], ' new: noAdmin prevents the admin group from being added to this group' );
181
161
$optionGroup -> delete ;
182
162
183
- # ###############################################################
184
- #
185
- # LDAP specific group properties
186
- # These tests have to be done on an isolated group that will NEVER
187
- # have getGroups called on it
188
- #
189
- # ###############################################################
190
-
191
- my $ldapProps = WebGUI::Test-> getSmokeLDAPProps();
192
- $session -> db-> setRow(' ldapLink' , ' ldapLinkId' , $ldapProps , $ldapProps -> {ldapLinkId });
193
- my $ldap = WebGUI::LDAPLink-> new($session , $ldapProps -> {ldapLinkId });
194
- is($ldap -> getValue(" ldapLinkId" ),$ldapProps -> {ldapLinkId },' ldap link created properly' );
195
- WebGUI::Test-> addToCleanup($ldap );
196
-
197
- my @shawshank ;
198
-
199
- foreach my $idx (0..$#ldapTests ) {
200
- $shawshank [$idx ] = WebGUI::User-> new($session , " new" );
201
- $shawshank [$idx ]-> username(" shawshank$idx " );
202
- $shawshank [$idx ]-> authMethod(" LDAP" );
203
- my $auth = $shawshank [$idx ]-> authInstance;
204
- $auth -> saveParams($shawshank [$idx ]-> getId,$shawshank [$idx ]-> authMethod,{
205
- connectDN => $ldapTests [$idx ]-> {dn },
206
- ldapConnection => $ldap -> getValue(" ldapLinkId" ),
207
- ldapUrl => $ldap -> getValue(" ldapUrl" ),
208
- });
209
- }
210
-
211
- WebGUI::Test-> addToCleanup(@shawshank );
212
-
213
- my $lGroup = WebGUI::Group-> new($session , ' new' );
214
-
215
- $lGroup -> ldapGroup(' cn=Convicts,o=shawshank' );
216
- is($lGroup -> ldapGroup(), ' cn=Convicts,o=shawshank' , ' ldapGroup set and fetched correctly' );
217
-
218
- $lGroup -> ldapGroupProperty(' member' );
219
- is($lGroup -> ldapGroupProperty(), ' member' , ' ldapGroup set and fetched correctly' );
220
-
221
- $lGroup -> ldapLinkId($ldapProps -> {ldapLinkId });
222
- is($lGroup -> ldapLinkId(),$ldapProps -> {ldapLinkId }, ' ldapLinkId set and fetched correctly' );
223
-
224
- is_deeply(
225
- [ (map { $lGroup -> hasLDAPUser($_ -> getId) } @shawshank ) ],
226
- [0, 1, 1],
227
- ' shawshank user 2, and 3 found in lGroup users from LDAP'
228
- );
229
-
230
- $lGroup -> ldapRecursiveProperty(' LDAP recursive property' );
231
- is($lGroup -> ldapRecursiveProperty(), ' LDAP recursive property' , ' ldapRecursiveProperty set and fetched correctly' );
232
-
233
- $lGroup -> ldapRecursiveFilter(' LDAP recursive filter' );
234
- is($lGroup -> ldapRecursiveFilter(), ' LDAP recursive filter' , ' ldapRecursiveFilter set and fetched correctly' );
235
-
236
- $lGroup -> delete ;
237
-
238
163
my $gid = $g -> getId;
239
164
is (length ($gid ), 22, " GroupId is proper length" );
240
165
870
795
" registered users: don't get the users in both groups" ,
871
796
);
872
797
798
+ done_testing;
873
799
874
800
# vim:ft=perl
0 commit comments