Revision 231 (by dpavlin, 2008/08/31 11:54:40) Added action SearchLDAP which replace old dump and enables us to issue
search requests directly to upstream LDAP to check it's current data
#!/usr/bin/env perl
use warnings;
use strict;

=head1 DESCRIPTION

A (very) basic test harness for the SearchLDAP action.

=cut

use Jifty::Test tests => 6;
use Data::Dump qw/dump/;

# Make sure we can load the action
use_ok('A3C::Action::SearchLDAP');

my $action = Jifty::Test->web->new_action(
	class        => 'SearchLDAP',
#	current_user => $system_user,
	arguments    => {
		base => 'dc=skole,dc=hr',
		filter => 'objectClass=hrEduOrg',
		sizelimit => 3,
	}
);

isa_ok( $action, 'A3C::Action::SearchLDAP' );

$action->run;

ok( $action->result->success, 'result is success' );

ok( my $search = $action->result->content( 'current_search' ), 'result content have current_search' );

isa_ok( $search, "Net::LDAP::Search" );

#diag dump( $search->entries );

cmp_ok( $search->entries, '==', 3, 'entries' );