--- t/10-ldap.t 2008/03/30 16:58:21 42 +++ t/10-ldap.t 2008/05/01 17:06:02 106 @@ -8,7 +8,8 @@ =cut -use Jifty::Test tests => 19; +use Jifty::Test tests => 29; +use Data::Dump qw/dump/; use_ok('A3C::LDAP'); @@ -16,6 +17,12 @@ isa_ok( $ldap, 'A3C::LDAP' ); +isa_ok( $ldap->objectClass, 'HASH', 'have objectClass' ); +isa_ok( $ldap->link, 'HASH', 'have link' ); + +diag "objectClass = ",dump( $ldap->objectClass ); +diag "link = ",dump( $ldap->link ); + ok( $ldap->search( base => 'dc=skole,dc=hr', @@ -33,8 +40,11 @@ # $entry->dump; } -ok( my $collection = $ldap->collection('Organization', 3), 'collection Organization' ); - -isa_ok( $collection, 'A3C::Model::OrganizationCollection' ); +foreach my $limit ( 3, 7, 14 ) { + ok( my $collection = $ldap->collection('Organization', limit => $limit), "collection Organization limit = $limit" ); + isa_ok( $collection, 'A3C::Model::OrganizationCollection' ); + is( $collection->count, $limit, 'count' ); +} -is( $collection->count, 3, 'count' ); +ok( my $coll = $ldap->collection('Person', filter => '(HrEduPersonHomeOrg=aa-test-zz)'), 'collection with filter' ); +is( $coll->count, 0, 'no results' );