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; |
31c69ff5 |
5 | |
e385da71 |
6 | use Test::More; |
31c69ff5 |
7 | |
8 | use lib 't/lib'; |
9 | use LDAPTest; |
10 | |
11 | my $server = LDAPTest::spawn_server(); |
12 | |
13 | use_ok("Catalyst::Authentication::Store::LDAP::Backend"); |
14 | |
15 | my $back = Catalyst::Authentication::Store::LDAP::Backend->new( |
16 | { 'ldap_server' => LDAPTest::server_host(), |
17 | |
18 | # can test the timeout SKIP with this |
19 | 'ldap_server_options' => |
20 | { timeout => -1, debug => $ENV{PERL_DEBUG} || 0 }, |
21 | |
22 | 'binddn' => 'anonymous', |
23 | 'bindpw' => 'dontcarehow', |
24 | 'start_tls' => 0, |
25 | 'user_basedn' => 'ou=foobar', |
26 | 'user_filter' => '(&(objectClass=person)(uid=%s))', |
27 | 'user_scope' => 'one', |
28 | 'user_field' => 'uid', |
29 | 'use_roles' => 0, |
30 | } |
31 | ); |
32 | isa_ok( $back, "Catalyst::Authentication::Store::LDAP::Backend" ); |
33 | |
34 | ok( my $user_mixed = $back->find_user( { username => 'SOmeBOdy' } ), "find_user (mixed case)" ); |
35 | isa_ok( $user_mixed, "Catalyst::Authentication::Store::LDAP::User" ); |
36 | |
e385da71 |
37 | done_testing; |