5 use Catalyst::Exception;
10 my $server = LDAPTest::spawn_server();
12 use_ok("Catalyst::Authentication::Store::LDAP::Backend");
14 my $back = Catalyst::Authentication::Store::LDAP::Backend->new(
15 { 'ldap_server' => LDAPTest::server_host(),
17 # can test the timeout SKIP with this
18 'ldap_server_options' =>
19 { timeout => -1, debug => $ENV{PERL_DEBUG} || 0 },
21 'binddn' => 'anonymous',
22 'bindpw' => 'dontcarehow',
24 'user_basedn' => 'ou=foobar',
25 'user_filter' => '(&(objectClass=person)(uid=%s))',
26 'user_scope' => 'one',
27 'user_field' => 'uid',
32 isa_ok( $back, "Catalyst::Authentication::Store::LDAP::Backend", 'LDAP backed' );
35 ['somebody', 'Some Body'],
36 ['sunnO)))', 'Sunn O)))'],
37 ['some*', 'Some Star'],
39 my ($username, $name) = @$_;
41 my $user = $back->find_user( { username => $username } );
42 isa_ok( $user, "Catalyst::Authentication::Store::LDAP::User", "find_user('$username') result" );
43 my $displayname = $user->displayname;
44 is( $displayname, $name, 'Display name' );