Merge 'better_model_integration' into 'trunk'
[catagits/Catalyst-Authentication-Store-LDAP.git] / t / 50.auth.case.sensitivity.t
CommitLineData
31c69ff5 1#!/usr/bin/env perl
2# vim: ts=8 sts=4 et sw=4 sr sta
3use strict;
4use warnings;
5use Catalyst::Exception;
6
7use Test::More tests => 4;
8
9use lib 't/lib';
10use LDAPTest;
11
12my $server = LDAPTest::spawn_server();
13
14use_ok("Catalyst::Authentication::Store::LDAP::Backend");
15
16my $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);
33isa_ok( $back, "Catalyst::Authentication::Store::LDAP::Backend" );
34
35ok( my $user_mixed = $back->find_user( { username => 'SOmeBOdy' } ), "find_user (mixed case)" );
36isa_ok( $user_mixed, "Catalyst::Authentication::Store::LDAP::User" );
37