[Catalyst-commits] r6596 - in trunk/Catalyst-Model-LDAP: .
lib/Catalyst/Model lib/Catalyst/Model/LDAP t
dwc at dev.catalyst.perl.org
dwc at dev.catalyst.perl.org
Sat Jul 28 01:14:18 GMT 2007
Author: dwc
Date: 2007-07-28 01:14:17 +0100 (Sat, 28 Jul 2007)
New Revision: 6596
Added:
trunk/Catalyst-Model-LDAP/t/unit_Entry.t
Modified:
trunk/Catalyst-Model-LDAP/Changes
trunk/Catalyst-Model-LDAP/lib/Catalyst/Model/LDAP.pm
trunk/Catalyst-Model-LDAP/lib/Catalyst/Model/LDAP/Entry.pm
Log:
Fix Catalyst::Model::LDAP::Entry's constructor
Modified: trunk/Catalyst-Model-LDAP/Changes
===================================================================
--- trunk/Catalyst-Model-LDAP/Changes 2007-07-27 18:18:57 UTC (rev 6595)
+++ trunk/Catalyst-Model-LDAP/Changes 2007-07-28 00:14:17 UTC (rev 6596)
@@ -1,5 +1,8 @@
Revision history for Perl extension Catalyst::Model::LDAP.
+0.16
+ - Fix Catalyst::Model::LDAP::Entry's constructor
+
0.15 Fri Feb 23 11:37:25 EST 2007
- Throw runtime require errors
- Documentation fixes
Modified: trunk/Catalyst-Model-LDAP/lib/Catalyst/Model/LDAP/Entry.pm
===================================================================
--- trunk/Catalyst-Model-LDAP/lib/Catalyst/Model/LDAP/Entry.pm 2007-07-27 18:18:57 UTC (rev 6595)
+++ trunk/Catalyst-Model-LDAP/lib/Catalyst/Model/LDAP/Entry.pm 2007-07-28 00:14:17 UTC (rev 6596)
@@ -2,7 +2,7 @@
use strict;
use warnings;
-use base qw/Class::Accessor::Fast Net::LDAP::Entry/;
+use base qw/Net::LDAP::Entry Class::Accessor::Fast/;
use Carp qw/croak/;
use Class::C3;
@@ -81,11 +81,13 @@
=cut
sub new {
- my $class = shift;
+ my ($class, $dn, %attributes) = @_;
- my $self = $class->next::method(@_);
+ my $client = delete $attributes{_ldap_client};
- if (my $client = shift) {
+ my $self = $class->next::method($dn, %attributes);
+
+ if ($client) {
$self->_ldap_client($client);
}
Modified: trunk/Catalyst-Model-LDAP/lib/Catalyst/Model/LDAP.pm
===================================================================
--- trunk/Catalyst-Model-LDAP/lib/Catalyst/Model/LDAP.pm 2007-07-27 18:18:57 UTC (rev 6595)
+++ trunk/Catalyst-Model-LDAP/lib/Catalyst/Model/LDAP.pm 2007-07-28 00:14:17 UTC (rev 6596)
@@ -5,7 +5,7 @@
use base qw/Catalyst::Model/;
use Carp qw/croak/;
-our $VERSION = '0.15';
+our $VERSION = '0.16_01';
=head1 NAME
Added: trunk/Catalyst-Model-LDAP/t/unit_Entry.t
===================================================================
--- trunk/Catalyst-Model-LDAP/t/unit_Entry.t (rev 0)
+++ trunk/Catalyst-Model-LDAP/t/unit_Entry.t 2007-07-28 00:14:17 UTC (rev 6596)
@@ -0,0 +1,24 @@
+use strict;
+use warnings;
+use Catalyst::Model::LDAP::Entry;
+use Test::More;
+
+plan tests => 6;
+
+my $DN = 'uflEduUniversityId=FAKE,ou=People,dc=ufl,dc=edu';
+my $UID = 'dwc';
+my $LOGIN_SHELL = '/usr/local/bin/glshell';
+
+my $entry = Catalyst::Model::LDAP::Entry->new(
+ $DN,
+ uid => $UID,
+ loginShell => $LOGIN_SHELL,
+);
+
+isa_ok($entry, 'Catalyst::Model::LDAP::Entry');
+
+is($entry->dn, $DN, 'entry DN matches');
+is($entry->get_value('uid'), $UID, 'entry uid matches');
+is($entry->uid, $UID, 'entry uid via AUTOLOAD matches');
+is($entry->get_value('loginShell'), $LOGIN_SHELL, 'entry loginShell matches');
+is($entry->loginShell, $LOGIN_SHELL, 'entry loginShell via AUTOLOAD matches');
More information about the Catalyst-commits
mailing list