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