/[virtual-ldap]/t/ldap-koha.t
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /t/ldap-koha.t

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 76 by dpavlin, Tue Feb 23 01:05:04 2010 UTC revision 77 by dpavlin, Tue Feb 23 01:28:09 2010 UTC
# Line 3  Line 3 
3  use warnings;  use warnings;
4  use strict;  use strict;
5    
6  use Test::More tests => 37;  use Test::More tests => 75;
7  use Data::Dump qw(dump);  use Data::Dump qw(dump);
8    
9  BEGIN {  BEGIN {
# Line 21  ok( my $ldap = Net::LDAP->new( 'localhos Line 21  ok( my $ldap = Net::LDAP->new( 'localhos
21  ok( my $bind = $ldap->bind, 'bind' );  ok( my $bind = $ldap->bind, 'bind' );
22  ldap_check_error $bind;  ldap_check_error $bind;
23    
 my @test_searches = ( qw/  
 uid=dpavlin@ffzg.hr  
 pager=E00401001F77E218  
 / );  
   
24  sub check_search_attributes {  sub check_search_attributes {
25          my $search = shift;          my $search = shift;
26    
# Line 35  sub check_search_attributes { Line 30  sub check_search_attributes {
30          }          }
31  }  }
32    
33  foreach my $search ( @test_searches ) {  sub search {
34            my ($ldap,$search) = @_;
35          ok( my $search = $ldap->search( filter => $search ), "search $search" );          ok( my $search = $ldap->search( filter => $search ), "search $search" );
36          ldap_check_error $search;          ldap_check_error $search;
37          ok( $search->entries, 'have results' );          ok( $search->entries, 'have results' );
38          check_search_attributes $search => 'uid', 'mail', 'pager', 'memberOf';          return $search;
39    }
40    
41    foreach my $search ( qw/
42    uid=dpavlin@ffzg.hr
43    pager=E00401001F77E218
44    / ) {
45            my $entries = search $ldap => $search;
46            check_search_attributes $entries => 'uid', 'mail', 'pager', 'memberOf';
47    
48            $entries = search $ldap => "(&(objectclass=HrEduPerson)($search))";
49            check_search_attributes $entries => 'uid', 'mail', 'pager', 'memberOf';
50  }  }
51    
52    search $ldap => $_ foreach ( qw/
53    objectclass=organizationalUnit
54    objectclass=group
55    / );
56    
57  ok( $ldap->unbind, 'unbind' );  ok( $ldap->unbind, 'unbind' );

Legend:
Removed from v.76  
changed lines
  Added in v.77

  ViewVC Help
Powered by ViewVC 1.1.26