/[A3C]/t/10-ldap.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

Annotation of /t/10-ldap.t

Parent Directory Parent Directory | Revision Log Revision Log


Revision 53 - (hide annotations)
Tue Apr 1 17:32:59 2008 UTC (14 years, 3 months ago) by dpavlin
File MIME type: application/x-troff
File size: 914 byte(s)
added filter arg to add additional filter to search
1 dpavlin 36 #!/usr/bin/env perl
2     use warnings;
3     use strict;
4    
5     =head1 DESCRIPTION
6    
7     test LDAP module
8    
9     =cut
10    
11 dpavlin 53 use Jifty::Test tests => 27;
12 dpavlin 36
13     use_ok('A3C::LDAP');
14    
15 dpavlin 40 ok( my $ldap = A3C::LDAP->new, 'new' );
16    
17     isa_ok( $ldap, 'A3C::LDAP' );
18    
19 dpavlin 36 ok(
20 dpavlin 40 $ldap->search(
21 dpavlin 36 base => 'dc=skole,dc=hr',
22     filter => '(objectClass=hrEduOrg)',
23 dpavlin 42 sizelimit => 10,
24 dpavlin 36 )
25     ), 'search';
26    
27 dpavlin 40 isa_ok( $ldap, 'A3C::LDAP' );
28 dpavlin 36
29 dpavlin 42 cmp_ok( $ldap->count, '==', 10, 'count' );
30 dpavlin 36
31 dpavlin 40 foreach my $i ( 1 .. 10 ) {
32     ok( my $entry = $ldap->next, "next $i" );
33     # $entry->dump;
34     }
35 dpavlin 42
36 dpavlin 47 foreach my $limit ( 3, 7, 14 ) {
37     ok( my $collection = $ldap->collection('Organization', limit => $limit), "collection Organization limit = $limit" );
38     isa_ok( $collection, 'A3C::Model::OrganizationCollection' );
39     is( $collection->count, $limit, 'count' );
40     }
41 dpavlin 53
42     ok( my $coll = $ldap->collection('User', filter => '(HrEduPersonHomeOrg=aa-test-zz)'), 'collection with filter' );
43     is( $coll->count, 0, 'no results' );

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.26