Commit | Line | Data |
31c69ff5 |
1 | #!/usr/bin/env perl |
2 | # vim: ts=8 sts=4 et sw=4 sr sta |
3 | use strict; |
4 | use warnings; |
5 | use Catalyst::Exception; |
6 | |
7 | use Test::More tests => 4; |
8 | |
9 | use lib 't/lib'; |
10 | use LDAPTest; |
11 | |
12 | my $server = LDAPTest::spawn_server(); |
13 | |
14 | use_ok("Catalyst::Authentication::Store::LDAP::Backend"); |
15 | |
16 | my $back = Catalyst::Authentication::Store::LDAP::Backend->new( |
17 | { 'ldap_server' => LDAPTest::server_host(), |
18 | |
19 | # can test the timeout SKIP with this |
20 | 'ldap_server_options' => |
21 | { timeout => -1, debug => $ENV{PERL_DEBUG} || 0 }, |
22 | |
23 | 'binddn' => 'anonymous', |
24 | 'bindpw' => 'dontcarehow', |
25 | 'start_tls' => 0, |
26 | 'user_basedn' => 'ou=foobar', |
27 | 'user_filter' => '(&(objectClass=person)(uid=%s))', |
28 | 'user_scope' => 'one', |
29 | 'user_field' => 'uid', |
30 | 'use_roles' => 0, |
31 | } |
32 | ); |
33 | isa_ok( $back, "Catalyst::Authentication::Store::LDAP::Backend" ); |
34 | |
35 | ok( my $user_mixed = $back->find_user( { username => 'SOmeBOdy' } ), "find_user (mixed case)" ); |
36 | isa_ok( $user_mixed, "Catalyst::Authentication::Store::LDAP::User" ); |
37 | |