5 use Catalyst::Exception;
7 use Test::More tests => 6;
13 eval "use Catalyst::Model::LDAP";
15 skip "Catalyst::Model::LDAP not installed", 6;
18 my $server = LDAPTest::spawn_server();
20 use_ok("Catalyst::Authentication::Store::LDAP::Backend");
22 my $back = Catalyst::Authentication::Store::LDAP::Backend->new(
23 { 'ldap_server' => LDAPTest::server_host(),
24 'binddn' => 'anonymous',
25 'bindpw' => 'dontcarehow',
27 'user_basedn' => 'ou=foobar',
28 'user_filter' => '(&(objectClass=person)(uid=%s))',
29 'user_scope' => 'one',
30 'user_field' => 'uid',
32 'entry_class' => 'EntryClass',
36 isa_ok( $back, "Catalyst::Authentication::Store::LDAP::Backend" );
37 my $user = $back->find_user( { username => 'somebody' } );
38 isa_ok( $user, "Catalyst::Authentication::Store::LDAP::User" );
39 my $displayname = $user->displayname;
40 cmp_ok( $displayname, 'eq', 'Some Body', 'Should be Some Body' );
42 isa_ok( $user->ldap_entry, "EntryClass", "entry_class works" );
43 is( $user->ldap_entry->my_method, 1001, "methods on entry_class works" );