Fix unit tests after introducing RegisterDB (#26)

This commit is contained in:
Clément Oudot 2014-05-29 07:38:50 +00:00
parent 81dbe943c3
commit 9b10d96341
20 changed files with 68 additions and 2 deletions

View File

@ -896,6 +896,13 @@ has 'redirectFormMethod' => (
documentation => 'HTTP method for redirect page form',
);
has 'registerDB' => (
is => 'rw',
isa => 'Str',
default => 'Demo',
documentation => 'Register module',
);
has 'remoteGlobalStorage' => (
is => 'rw',
isa => 'Str',

View File

@ -0,0 +1,36 @@
##@file
# Demo register backend file
##@class
# Demo register backend class
package Lemonldap::NG::Portal::RegisterDBDemo;
use strict;
use Lemonldap::NG::Portal::Simple;
## @method int computeLogin
# Compute a login from register infos
# @result Lemonldap::NG::Portal constant
sub computeLogin {
my ($self) = splice @_;
# Get first letter of firstname and lastname
my $login =
substr( lc $self->{registerInfo}->{firstname}, 0, 1 )
. lc $self->{registerInfo}->{lastname};
$self->{registerInfo}->{login} = $login;
return PE_OK;
}
## @method int createUser
# Do nothing
# @result Lemonldap::NG::Portal constant
sub createUser {
my ($self) = splice @_;
return PE_OK;
}
1;

View File

@ -11,6 +11,7 @@ use Lemonldap::NG::Portal::Simple;
our $VERSION = '1.4.0';
sub getLogin {
my $self = splice @_;
$self->{registerInfo}->{login} = "";
return PE_OK;
}

View File

@ -41,6 +41,7 @@ ok(
authentication => 'LDAP test=1',
userDB => 'LDAP',
passwordDB => 'LDAP',
registerDB => 'LDAP',
cookieName => 'lemonldap',
whatToTrace => '_user',
multiValuesSeparator => '; ',
@ -71,6 +72,7 @@ $p = Lemonldap::NG::Portal::Simple->new(
authentication => 'LDAP test=1',
userDB => 'Null',
passwordDB => 'Null',
registerDB => 'Null',
cookieName => 'lemonldap',
whatToTrace => 'dummy',
multiValuesSeparator => '; ',

View File

@ -134,6 +134,7 @@ ok(
authentication => 'LDAP test=1',
userDB => 'Null',
passwordDB => 'Null',
registerDB => 'Null',
domain => 'example.com',
trustedDomains => '.example2.com example3.com',
checkXSS => 1,

View File

@ -78,6 +78,7 @@ SKIP: {
authentication => 'Null',
userDB => 'Null',
passwordDB => 'Null',
registerDB => 'Null',
soap => 1,
}
),

View File

@ -25,6 +25,7 @@ ok(
authentication => 'Null',
userDB => 'Null',
passwordDB => 'Null',
registerDB => 'Null',
useSafeJail => 1,
}
),

View File

@ -23,6 +23,7 @@ ok(
authentication => 'Apache',
userDB => 'Null',
passwordDB => 'Null',
registerDB => 'Null',
}
)
);

View File

@ -23,6 +23,7 @@ ok(
authentication => 'SSL',
userDB => 'Null',
passwordDB => 'Null',
registerDB => 'Null',
}
)
);

View File

@ -35,6 +35,7 @@ SKIP: {
authentication => 'CAS',
userDB => 'Null',
passwordDB => 'Null',
registerDB => 'Null',
CAS_url => 'https://cas.example.com',
CAS_pgt => '/tmp/pgt.txt',
CAS_proxiedServices => {},
@ -50,6 +51,7 @@ SKIP: {
authentication => 'CAS',
userDB => 'Null',
passwordDB => 'Null',
registerDB => 'Null',
CAS_url => 'https://cas.example.com',
CAS_pgt => '/tmp/pgt.txt',
CAS_proxiedServices => { 'CAS1' => 'http://cas1.example.com' },

View File

@ -58,6 +58,7 @@ ok(
authentication => 'Remote',
userDB => 'Null',
passwordDB => 'Null',
registerDB => 'Null',
cookieName => 'lemonldap',
portal => 'http://abc',
remotePortal => 'http://zz/',

View File

@ -81,6 +81,7 @@ my ( $test, $testU );
authentication => 'Multi 1;2',
userDB => 'Multi 1;2',
passwordDB => 'Null',
registerDB => 'Null',
cookieName => 'lemonldap',
whatToTrace => 'dummy',
multiValuesSeparator => '; ',
@ -115,6 +116,7 @@ my ( $test, $testU );
authentication => 'Multi 1;2',
userDB => 'Multi 1;2',
passwordDB => 'Null',
registerDB => 'Null',
cookieName => 'lemonldap',
whatToTrace => 'dummy',
multiValuesSeparator => '; ',
@ -143,6 +145,7 @@ my ( $test, $testU );
authentication => 'Multi 1;2',
userDB => 'Multi 3;4',
passwordDB => 'Null',
registerDB => 'Null',
cookieName => 'lemonldap',
whatToTrace => 'dummy',
multiValuesSeparator => '; ',
@ -171,6 +174,7 @@ my ( $test, $testU );
authentication => 'Multi 1 1==0;2 1==0',
userDB => 'Multi 3;4',
passwordDB => 'Null',
registerDB => 'Null',
cookieName => 'lemonldap',
whatToTrace => 'dummy',
multiValuesSeparator => '; ',
@ -196,6 +200,7 @@ my ( $test, $testU );
authentication => 'Multi 1;2 1==0',
userDB => 'Multi 3;4',
passwordDB => 'Null',
registerDB => 'Null',
cookieName => 'lemonldap',
whatToTrace => 'dummy',
multiValuesSeparator => '; ',
@ -221,6 +226,7 @@ my ( $test, $testU );
authentication => 'Multi 1;2 1==1',
userDB => 'Multi 3;4',
passwordDB => 'Null',
registerDB => 'Null',
cookieName => 'lemonldap',
whatToTrace => 'dummy',
multiValuesSeparator => '; ',

View File

@ -32,6 +32,7 @@ ok(
authentication => 'Choice',
userDB => 'Null',
passwordDB => 'Null',
registerDB => 'Null',
getUser => sub { PE_OK },
setSessionInfo => sub { PE_OK },
portal => 'http://abc',

View File

@ -58,6 +58,7 @@ ok(
authentication => 'Proxy',
userDB => 'Null',
passwordDB => 'Null',
registerDB => 'Null',
cookieName => 'lemonldap',
portal => 'http://abc',
soapAuthService => 'https://lm.com',

View File

@ -28,6 +28,7 @@ ok(
authentication => 'Null',
userDB => 'Null',
passwordDB => 'Null',
registerDB => 'Null',
exportedVars => { uid => "TEST_STRING", },
}
)

View File

@ -32,7 +32,7 @@ ok(
authentication => 'Null',
userDB => 'Null',
passwordDB => 'Null',
registerDB => 'Null',
}
),
'Portal object'

View File

@ -24,6 +24,7 @@ my $p = Lemonldap::NG::Portal::Simple->new(
authentication => 'Null',
userDB => 'Null',
passwordDB => 'Null',
registerDB => 'Null',
applicationList => {},
locationRules => {
'test.example.com' => {

View File

@ -23,7 +23,7 @@ SKIP: {
userDB => 'SAML',
issuerDB => 'Null',
passwordDB => 'Null',
registerDB => 'Null',
}
);

View File

@ -14,6 +14,7 @@ my $p = Lemonldap::NG::Portal::Simple->new(
authentication => 'Demo',
userDB => 'Null',
passwordDB => 'Null',
registerDB => 'Null',
applicationList => {},
locationRules => {
'test.example.com' => {

View File

@ -23,6 +23,7 @@ ok(
authentication => 'BrowserID',
userDB => 'Null',
passwordDB => 'Null',
registerDB => 'Null',
}
)
);