On 09/24/2007 12:19 PM, Adam Jacob wrote:
>
> I'll be happy to commit any of your patches and get a new release
> pushed out to CPAN.
>
> (Tests would be great!)
>
Attached is a test based on the existing simple.t test, but using the new
find_user() instead of the old get_user().
I started on some more tests to exercise some of the roles features, but the
attached at least exercises the changes in the patches I submitted.
--
Peter Karman . [EMAIL PROTECTED] . http://peknet.com/
#!/usr/bin/perl
use strict;
use warnings;
use Catalyst::Exception;
use Test::More tests => 4;
BEGIN { use_ok("Catalyst::Plugin::Authentication::Store::LDAP::Backend") }
my $back = Catalyst::Plugin::Authentication::Store::LDAP::Backend->new(
{ 'ldap_server' => 'ldap.openldap.org',
'binddn' => 'anonymous',
'bindpw' => 'dontcarehow',
'start_tls' => 0,
'user_basedn' => 'ou=People,dc=OpenLDAP,dc=Org',
'user_filter' => '(&(objectClass=person)(uid=%s))',
'user_scope' => 'one',
'user_field' => 'uid',
'use_roles' => 0,
}
);
isa_ok( $back, "Catalyst::Plugin::Authentication::Store::LDAP::Backend" );
my $user = $back->find_user( { username => 'kurt' } );
isa_ok( $user, "Catalyst::Plugin::Authentication::Store::LDAP::User" );
my $displayname = $user->displayname;
cmp_ok( $displayname, 'eq', 'Kurt Zeilenga', 'Should be Kurt Zeilenga' );
_______________________________________________
List: [email protected]
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/[EMAIL PROTECTED]/
Dev site: http://dev.catalyst.perl.org/