/[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 106 - (hide annotations)
Thu May 1 17:06:02 2008 UTC (15 years, 11 months ago) by dpavlin
File MIME type: application/x-troff
File size: 1131 byte(s)
massive re-structuring to enable models specified in configuration file

- version bump [0.04]
- SyncOrganization now accept org_uid as argument
- objectClass(es) for person and organization are now in config.yml
  as well as link between them (filter on person)
- config.yml is now checked for validity in A3C::LDAP
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 106 use Jifty::Test tests => 29;
12     use Data::Dump qw/dump/;
13 dpavlin 36
14     use_ok('A3C::LDAP');
15    
16 dpavlin 40 ok( my $ldap = A3C::LDAP->new, 'new' );
17    
18     isa_ok( $ldap, 'A3C::LDAP' );
19    
20 dpavlin 106 isa_ok( $ldap->objectClass, 'HASH', 'have objectClass' );
21     isa_ok( $ldap->link, 'HASH', 'have link' );
22    
23     diag "objectClass = ",dump( $ldap->objectClass );
24     diag "link = ",dump( $ldap->link );
25    
26 dpavlin 36 ok(
27 dpavlin 40 $ldap->search(
28 dpavlin 36 base => 'dc=skole,dc=hr',
29     filter => '(objectClass=hrEduOrg)',
30 dpavlin 42 sizelimit => 10,
31 dpavlin 36 )
32     ), 'search';
33    
34 dpavlin 40 isa_ok( $ldap, 'A3C::LDAP' );
35 dpavlin 36
36 dpavlin 42 cmp_ok( $ldap->count, '==', 10, 'count' );
37 dpavlin 36
38 dpavlin 40 foreach my $i ( 1 .. 10 ) {
39     ok( my $entry = $ldap->next, "next $i" );
40     # $entry->dump;
41     }
42 dpavlin 42
43 dpavlin 47 foreach my $limit ( 3, 7, 14 ) {
44     ok( my $collection = $ldap->collection('Organization', limit => $limit), "collection Organization limit = $limit" );
45     isa_ok( $collection, 'A3C::Model::OrganizationCollection' );
46     is( $collection->count, $limit, 'count' );
47     }
48 dpavlin 53
49 dpavlin 84 ok( my $coll = $ldap->collection('Person', filter => '(HrEduPersonHomeOrg=aa-test-zz)'), 'collection with filter' );
50 dpavlin 53 is( $coll->count, 0, 'no results' );

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.26