More tests

This commit is contained in:
Xavier Guimard 2019-08-27 10:32:26 +02:00
parent 323d92fa1b
commit 48883dbe4e
2 changed files with 45 additions and 2 deletions

View File

@ -19,7 +19,7 @@ has rules => ( is => 'rw', default => sub { {} } );
sub init {
my ($self) = @_;
my $hd = $self->p->HANDLER;
foreach ( keys %{ $self->conf->{grantSessionRules} } ) {
foreach ( keys %{ $self->conf->{grantSessionRules} // {} } ) {
$self->logger->debug("GrantRule key -> $_");
$self->logger->debug(
"GrantRule value -> " . $self->conf->{grantSessionRules}->{$_} );

View File

@ -1,6 +1,49 @@
use Test::More tests => 2;
use Test::More tests => 5;
use_ok('Lemonldap::NG::Portal::Main');
my ( $p, $app );
my $ini = {
configStorage => {
type => 'File',
dirName => 't',
},
localSessionStorage => 'Cache::FileCache',
localSessionStorageOptions => {
namespace => 'lemonldap-ng-session',
cache_root => 't/',
cache_depth => 0,
},
logLevel => 'error',
cookieName => 'lemonldap',
domain => 'example.com',
templateDir => 'site/templates',
staticPrefix => '/static',
loginHistoryEnabled => 1,
securedCookie => 0,
https => 0,
portalDisplayResetPassword => 1,
portalStatus => 1,
cda => 1,
notification => 1,
portalCheckLogins => 1,
stayConnected => 1,
bruteForceProtection => 1,
grantSessionRules => 1,
upgradeSession => 1,
autoSigninRules => { a => 1 },
checkState => 1,
portalForceAuthn => 1,
checkUser => 1,
impersonationRule => 1,
contextSwitchingRule => 1,
grantSessionRules => {},
checkStateSecret => 'x',
};
ok( $p = Lemonldap::NG::Portal::Main->new, 'Portal object' );
ok( $p->init($ini), 'Init' );
ok( $app = $p->run, 'App' );
eval { Data::Dumper::Dumper( {} ) };
ok( $@, "Portal don't depends on Data::Dumper" );