9 use Storable qw/ freeze /;
12 my $server = LDAPTest::spawn_server();
14 use_ok("Catalyst::Authentication::Store::LDAP::Backend");
16 my $back = Catalyst::Authentication::Store::LDAP::Backend->new(
17 { 'ldap_server' => LDAPTest::server_host(),
18 'binddn' => 'anonymous',
19 'bindpw' => 'dontcarehow',
21 'user_basedn' => 'ou=foobar',
22 'user_filter' => '(&(objectClass=person)(uid=%s))',
23 'user_scope' => 'one',
24 'user_field' => 'uid',
26 'user_class' => 'UserClass',
30 isa_ok( $back, "Catalyst::Authentication::Store::LDAP::Backend" );
31 my $user = $back->find_user( { username => 'somebody' } );
32 isa_ok( $user, "Catalyst::Authentication::Store::LDAP::User" );
33 isa_ok( $user, "UserClass");
35 is( $user->my_method, 'frobnitz', "methods on user class work" );
38 diag("stop() server");
41 $server = LDAPTest::spawn_server();
42 ok $user->check_password('foo'), 'Can check password';
45 lives_ok { $frozen_user = freeze $user } 'Can freeze user with Storable';
46 ok $frozen_user, 'is frozen';
49 diag("stop() server");