8 |
|
|
9 |
=cut |
=cut |
10 |
|
|
11 |
use Jifty::Test tests => 5; |
use Jifty::Test tests => 16; |
12 |
|
|
13 |
use_ok('A3C::LDAP'); |
use_ok('A3C::LDAP'); |
14 |
|
|
15 |
|
ok( my $ldap = A3C::LDAP->new, 'new' ); |
16 |
|
|
17 |
|
isa_ok( $ldap, 'A3C::LDAP' ); |
18 |
|
|
19 |
ok( |
ok( |
20 |
my $msg = A3C::LDAP->search( |
$ldap->search( |
21 |
base => 'dc=skole,dc=hr', |
base => 'dc=skole,dc=hr', |
22 |
filter => '(objectClass=hrEduOrg)', |
filter => '(objectClass=hrEduOrg)', |
23 |
) |
) |
24 |
), 'search'; |
), 'search'; |
25 |
|
|
26 |
diag 'code: ', $msg->code, ' count: ', $msg->count; |
isa_ok( $ldap, 'A3C::LDAP' ); |
|
|
|
|
isa_ok( $msg, 'Net::LDAP::Search' ); |
|
|
|
|
|
is( $msg->code, 0, 'code' ); |
|
27 |
|
|
28 |
cmp_ok( $msg->count, '>', 1000, 'count' ); |
cmp_ok( $ldap->count, '>', 1000, 'count' ); |
29 |
|
|
30 |
|
foreach my $i ( 1 .. 10 ) { |
31 |
|
ok( my $entry = $ldap->next, "next $i" ); |
32 |
|
# $entry->dump; |
33 |
|
} |