8 |
|
|
9 |
=cut |
=cut |
10 |
|
|
11 |
use Jifty::Test tests => 27; |
use Jifty::Test tests => 29; |
12 |
|
use Data::Dump qw/dump/; |
13 |
|
|
14 |
use_ok('A3C::LDAP'); |
use_ok('A3C::LDAP'); |
15 |
|
|
17 |
|
|
18 |
isa_ok( $ldap, 'A3C::LDAP' ); |
isa_ok( $ldap, 'A3C::LDAP' ); |
19 |
|
|
20 |
|
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 |
ok( |
ok( |
27 |
$ldap->search( |
$ldap->search( |
28 |
base => 'dc=skole,dc=hr', |
base => 'dc=skole,dc=hr', |
40 |
# $entry->dump; |
# $entry->dump; |
41 |
} |
} |
42 |
|
|
43 |
|
my $org_oc = $ldap->objectClass->{organization}; |
44 |
|
|
45 |
foreach my $limit ( 3, 7, 14 ) { |
foreach my $limit ( 3, 7, 14 ) { |
46 |
ok( my $collection = $ldap->collection('Organization', limit => $limit), "collection Organization limit = $limit" ); |
ok( my $collection = $ldap->collection( $org_oc, limit => $limit), "collection $org_oc limit = $limit" ); |
47 |
isa_ok( $collection, 'A3C::Model::OrganizationCollection' ); |
isa_ok( $collection, "A3C::Model::${org_oc}Collection" ); |
48 |
is( $collection->count, $limit, 'count' ); |
is( $collection->count, $limit, 'count' ); |
49 |
} |
} |
50 |
|
|
51 |
ok( my $coll = $ldap->collection('Person', filter => '(HrEduPersonHomeOrg=aa-test-zz)'), 'collection with filter' ); |
my $person_oc = $ldap->objectClass->{person}; |
52 |
|
|
53 |
|
ok( my $coll = $ldap->collection( $person_oc, filter => '(HrEduPersonHomeOrg=aa-test-zz)'), 'collection with filter' ); |
54 |
is( $coll->count, 0, 'no results' ); |
is( $coll->count, 0, 'no results' ); |