diff --git a/modules/lemonldap-ng-handler/lib/Lemonldap/NG/Handler.pm b/modules/lemonldap-ng-handler/lib/Lemonldap/NG/Handler.pm index f354fbd2e..8bf5e02df 100644 --- a/modules/lemonldap-ng-handler/lib/Lemonldap/NG/Handler.pm +++ b/modules/lemonldap-ng-handler/lib/Lemonldap/NG/Handler.pm @@ -2,7 +2,7 @@ package Lemonldap::NG::Handler; print STDERR "See Lemonldap::NG::Handler(3) to know which Lemonldap::NG::Handler::* module to use."; -our $VERSION = "0.8"; +our $VERSION = "0.81"; 1; diff --git a/modules/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/CGI.pm b/modules/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/CGI.pm index d81751b2a..fba46258a 100644 --- a/modules/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/CGI.pm +++ b/modules/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/CGI.pm @@ -10,13 +10,14 @@ our @ISA = qw(CGI); use Lemonldap::NG::Handler::SharedConf qw(:all); -our $VERSION = '0.01'; +our $VERSION = '0.02'; sub new { my $class = shift; my $self = $class->SUPER::new(); $self->{_handler} = bless {}, 'Lemonldap::NG::Handler::_CGI'; $self->_handler->init( @_ ); + $self->initLocalStorage(); die "Unable to get configuration" unless $self->_handler->localConfUpdate() == OK; return $self; } diff --git a/modules/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/Simple.pm b/modules/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/Simple.pm index c75affbf0..355139d6e 100644 --- a/modules/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/Simple.pm +++ b/modules/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/Simple.pm @@ -7,7 +7,7 @@ use Exporter 'import'; use Safe; require POSIX; -our $VERSION = '0.8'; +our $VERSION = '0.81'; our %EXPORT_TAGS = ( localStorage => @@ -231,7 +231,7 @@ sub localInit($$) { $localStorageOptions->{default_expires_in} ||= 600; eval "use $localStorage;"; - die("Unable to load $localStorage") if ($@); + die("Unable to load $localStorage: $@") if ($@); # At each Apache (re)start, we've to clear the cache to avoid living # with old datas @@ -269,6 +269,7 @@ sub localInit($$) { PerlCleanupHandler => sub { return $class->cleanLocalStorage(@_); } ); } + 1; } # Global initialization process : @@ -308,6 +309,7 @@ sub locationRulesInit { # Default police: all authenticated users are accepted $defaultCondition = $class->conditionSub('accept') unless ($defaultCondition); + 1; } # conditionSub returns a pre-compiled subroutine used to grant users (used by @@ -336,6 +338,7 @@ sub defaultValuesInit { $whatToTrace =~ s/\$//g; $https = $args->{https} unless defined($https); $https = 1 unless defined($https); + 1; } # portalInit : verify that portal variable exists @@ -385,6 +388,7 @@ sub forgeHeadersInit { $forgeHeaders = $safe->reval("sub {$sub};"); $class->lmLog( "$class: Unable to forge headers: $@: sub {$sub}", 'error' ) if ($@); + 1; } ################ diff --git a/modules/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/Vhost.pm b/modules/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/Vhost.pm index 24dd101c4..d03618f7a 100644 --- a/modules/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/Vhost.pm +++ b/modules/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/Vhost.pm @@ -29,6 +29,7 @@ sub locationRulesInit { $defaultCondition->{$vhost} = $class->conditionSub('accept') unless ( $defaultCondition->{$vhost} ); } + 1; } sub forgeHeadersInit { @@ -56,6 +57,7 @@ sub forgeHeadersInit { 'error' ) if ($@); } + 1; } sub sendHeaders { diff --git a/modules/lemonldap-ng-handler/t/Lemonldap-NG-Handler-CDA.t b/modules/lemonldap-ng-handler/t/Lemonldap-NG-Handler-CDA.t index fc54a1671..794127806 100644 --- a/modules/lemonldap-ng-handler/t/Lemonldap-NG-Handler-CDA.t +++ b/modules/lemonldap-ng-handler/t/Lemonldap-NG-Handler-CDA.t @@ -6,7 +6,7 @@ # change 'tests => 1' to 'tests => last_test_to_print'; use Test::More tests => 1; -BEGIN { use_ok('Lemonldap::NG::Handler::CDA') }; +BEGIN { use_ok('Lemonldap::NG::Handler::CDA') } ######################### diff --git a/modules/lemonldap-ng-handler/t/Lemonldap-NG-Handler-CGI.t b/modules/lemonldap-ng-handler/t/Lemonldap-NG-Handler-CGI.t index 69ecc40ae..630dc3a05 100644 --- a/modules/lemonldap-ng-handler/t/Lemonldap-NG-Handler-CGI.t +++ b/modules/lemonldap-ng-handler/t/Lemonldap-NG-Handler-CGI.t @@ -6,7 +6,7 @@ # change 'tests => 1' to 'tests => last_test_to_print'; use Test::More tests => 1; -BEGIN { use_ok('Lemonldap::NG::Handler::CGI') }; +BEGIN { use_ok('Lemonldap::NG::Handler::CGI') } ######################### diff --git a/modules/lemonldap-ng-handler/t/Lemonldap-NG-Handler-Proxy.t b/modules/lemonldap-ng-handler/t/Lemonldap-NG-Handler-Proxy.t index a85536b2f..48b18c6d1 100644 --- a/modules/lemonldap-ng-handler/t/Lemonldap-NG-Handler-Proxy.t +++ b/modules/lemonldap-ng-handler/t/Lemonldap-NG-Handler-Proxy.t @@ -6,7 +6,7 @@ # change 'tests => 1' to 'tests => last_test_to_print'; use Test::More tests => 1; -BEGIN { use_ok('Lemonldap::NG::Handler::Proxy') }; +BEGIN { use_ok('Lemonldap::NG::Handler::Proxy') } ######################### diff --git a/modules/lemonldap-ng-handler/t/Lemonldap-NG-Handler-SharedConf.t b/modules/lemonldap-ng-handler/t/Lemonldap-NG-Handler-SharedConf.t index 00f64e65b..a73759bd6 100644 --- a/modules/lemonldap-ng-handler/t/Lemonldap-NG-Handler-SharedConf.t +++ b/modules/lemonldap-ng-handler/t/Lemonldap-NG-Handler-SharedConf.t @@ -6,7 +6,7 @@ # change 'tests => 1' to 'tests => last_test_to_print'; use Test::More tests => 1; -BEGIN { use_ok('Lemonldap::NG::Handler::SharedConf') }; +BEGIN { use_ok('Lemonldap::NG::Handler::SharedConf') } ######################### diff --git a/modules/lemonldap-ng-handler/t/Lemonldap-NG-Handler-Simple.t b/modules/lemonldap-ng-handler/t/Lemonldap-NG-Handler-Simple.t index 02dca05ba..88faac6e2 100644 --- a/modules/lemonldap-ng-handler/t/Lemonldap-NG-Handler-Simple.t +++ b/modules/lemonldap-ng-handler/t/Lemonldap-NG-Handler-Simple.t @@ -5,11 +5,49 @@ # change 'tests => 1' to 'tests => last_test_to_print'; -use Test::More tests => 1; -BEGIN { use_ok('Lemonldap::NG::Handler::Simple') }; +use Test::More tests => 11; +BEGIN { use_ok( 'Lemonldap::NG::Handler::Simple', ':all' ) } ######################### # Insert your test code below, the Test::More module is use()ed here so read # its man page ( perldoc Test::More ) for help writing this test script. +my $h; +$h = bless {}, 'Lemonldap::NG::Handler::Simple'; +ok( + $h->localInit( + { + localStorage => 'Cache::FileCache', + localStorageOptions => { 'namespace' => 'MyNamespace', }, + } + ) +); +ok( + $h->locationRulesInit( + { + locationRules => { + default => 'accept', + '^/no' => 'deny', + 'test' => '$groups =~ /\badmin\b/', + }, + } + ) +); + +ok( $h->defaultValuesInit() ); +ok( $h->portalInit( { portal => 'http://auth.example.com' } ) ); +ok( + $h->globalStorageInit( + { + globalStorage => 'Apache::Session::File', + globalStorageOptions => {}, + } + ) +); +ok( $h->forgeHeadersInit ); +ok( $h->forgeHeadersInit( { exportedHeaders => { Auth => '$uid', } } ) ); + +ok( $h->grant('/s') ); +ok( !$h->grant('/no') ); +ok( $h->cleanLocalStorage == DECLINED ); diff --git a/modules/lemonldap-ng-handler/t/Lemonldap-NG-Handler-Vhost.t b/modules/lemonldap-ng-handler/t/Lemonldap-NG-Handler-Vhost.t index 2feeb41aa..eb481bb80 100644 --- a/modules/lemonldap-ng-handler/t/Lemonldap-NG-Handler-Vhost.t +++ b/modules/lemonldap-ng-handler/t/Lemonldap-NG-Handler-Vhost.t @@ -5,11 +5,41 @@ # change 'tests => 1' to 'tests => last_test_to_print'; -use Test::More tests => 1; -BEGIN { use_ok('Lemonldap::NG::Handler::Vhost') }; +package My::Package; + +use Test::More tests => 4; + +BEGIN { + use_ok('Lemonldap::NG::Handler::Vhost'); + use_ok('Lemonldap::NG::Handler::Simple'); +} ######################### # Insert your test code below, the Test::More module is use()ed here so read # its man page ( perldoc Test::More ) for help writing this test script. +our @ISA = qw( Lemonldap::NG::Handler::Vhost Lemonldap::NG::Handler::Simple ); +my $h; +$h = bless {}, 'My::Package'; + +ok( + $h->locationRulesInit( + { + locationRules => { + www1 => { + default => 'accept', + '^/no' => 'deny', + 'test' => '$groups =~ /\badmin\b/', + }, + }, + } + ) +); + +ok( + $h->forgeHeadersInit( + { exportedHeaders => { www1 => { Auth => '$uid', } } } + ) +); + diff --git a/modules/lemonldap-ng-manager/t/Lemonldap-NG-Manager-Conf-DBI.t b/modules/lemonldap-ng-manager/t/Lemonldap-NG-Manager-Conf-DBI.t index 4512954bc..43a87a88b 100644 --- a/modules/lemonldap-ng-manager/t/Lemonldap-NG-Manager-Conf-DBI.t +++ b/modules/lemonldap-ng-manager/t/Lemonldap-NG-Manager-Conf-DBI.t @@ -6,7 +6,7 @@ # change 'tests => 1' to 'tests => last_test_to_print'; use Test::More tests => 1; -BEGIN { use_ok('Lemonldap::NG::Manager::Conf::DBI') }; +BEGIN { use_ok('Lemonldap::NG::Manager::Conf::DBI') } ######################### diff --git a/modules/lemonldap-ng-manager/t/Lemonldap-NG-Manager-Conf-File.t b/modules/lemonldap-ng-manager/t/Lemonldap-NG-Manager-Conf-File.t index 2c410f441..6fd26dd3c 100644 --- a/modules/lemonldap-ng-manager/t/Lemonldap-NG-Manager-Conf-File.t +++ b/modules/lemonldap-ng-manager/t/Lemonldap-NG-Manager-Conf-File.t @@ -6,7 +6,7 @@ # change 'tests => 1' to 'tests => last_test_to_print'; use Test::More tests => 1; -BEGIN { use_ok('Lemonldap::NG::Manager::Conf::File') }; +BEGIN { use_ok('Lemonldap::NG::Manager::Conf::File') } ######################### diff --git a/modules/lemonldap-ng-manager/t/Lemonldap-NG-Manager-Conf-SOAP.t b/modules/lemonldap-ng-manager/t/Lemonldap-NG-Manager-Conf-SOAP.t index 811024f45..61c32ea53 100644 --- a/modules/lemonldap-ng-manager/t/Lemonldap-NG-Manager-Conf-SOAP.t +++ b/modules/lemonldap-ng-manager/t/Lemonldap-NG-Manager-Conf-SOAP.t @@ -6,11 +6,15 @@ # change 'tests => 1' to 'tests => last_test_to_print'; use Test::More tests => 1; + # SOAP::Lite is not required, so Lemonldap::NG::Manager::Conf::SOAP may # not run. SKIP: { eval { require SOAP::Lite }; - skip "SOAP::Lite is not installed, so SOAP configuration access will not work", 1 if($@); + skip + "SOAP::Lite is not installed, so SOAP configuration access will not work", + 1 + if ($@); use_ok('Lemonldap::NG::Manager::Conf::SOAP'); } diff --git a/modules/lemonldap-ng-manager/t/Lemonldap-NG-Manager-Conf.t b/modules/lemonldap-ng-manager/t/Lemonldap-NG-Manager-Conf.t index d15a20f13..0aeab2ac0 100644 --- a/modules/lemonldap-ng-manager/t/Lemonldap-NG-Manager-Conf.t +++ b/modules/lemonldap-ng-manager/t/Lemonldap-NG-Manager-Conf.t @@ -6,7 +6,7 @@ # change 'tests => 1' to 'tests => last_test_to_print'; use Test::More tests => 1; -BEGIN { use_ok('Lemonldap::NG::Manager::Conf') }; +BEGIN { use_ok('Lemonldap::NG::Manager::Conf') } ######################### diff --git a/modules/lemonldap-ng-manager/t/Lemonldap-NG-Manager.t b/modules/lemonldap-ng-manager/t/Lemonldap-NG-Manager.t index 00db011f3..6859f34f1 100644 --- a/modules/lemonldap-ng-manager/t/Lemonldap-NG-Manager.t +++ b/modules/lemonldap-ng-manager/t/Lemonldap-NG-Manager.t @@ -16,8 +16,9 @@ BEGIN { use_ok('Lemonldap::NG::Manager') } $ENV{SCRIPT_NAME} = "__SCRIPTNAME__"; $ENV{SCRIPT_FILENAME} = $0; my $h; -@ARGV = ( "help=groups" ); -ok( $h = new Lemonldap::NG::Manager( +@ARGV = ("help=groups"); +ok( + $h = new Lemonldap::NG::Manager( { configStorage => { type => 'File', @@ -26,7 +27,8 @@ ok( $h = new Lemonldap::NG::Manager( dhtmlXTreeImageLocation => "/imgs/", jsFile => 'example/lemonldap-ng-manager.js', } -)); + ) +); ok( $h->header_public() ); ok( $h->start_html() ); ok( $h->main() ); @@ -36,10 +38,10 @@ ok( $h->print_lmjs() ); ok( $h->print_help() ); ok( $h->buildTree() ); my $tmp = &xml; -ok( ref($h->tree2conf( \$tmp )) ); +ok( ref( $h->tree2conf( \$tmp ) ) ); sub xml { -return << 'EOF'; + return << 'EOF'; Configuration 9 Paramtres gnraux Paramtres d'authentification diff --git a/modules/lemonldap-ng-manager/t/Lemonldap-NG-Manager_en.t b/modules/lemonldap-ng-manager/t/Lemonldap-NG-Manager_en.t index f38fd7513..5e65e38da 100644 --- a/modules/lemonldap-ng-manager/t/Lemonldap-NG-Manager_en.t +++ b/modules/lemonldap-ng-manager/t/Lemonldap-NG-Manager_en.t @@ -17,8 +17,9 @@ $ENV{SCRIPT_NAME} = "__SCRIPTNAME__"; $ENV{SCRIPT_FILENAME} = $0; $ENV{HTTP_ACCEPT_LANGUAGE} = "en"; my $h; -@ARGV = ( "help=groups" ); -ok( $h = new Lemonldap::NG::Manager( +@ARGV = ("help=groups"); +ok( + $h = new Lemonldap::NG::Manager( { configStorage => { type => 'File', @@ -27,7 +28,8 @@ ok( $h = new Lemonldap::NG::Manager( dhtmlXTreeImageLocation => "/imgs/", jsFile => 'example/lemonldap-ng-manager.js', } -)); + ) +); ok( $h->main() ); ok( $h->print_help() ); ok( $h->buildTree() ); diff --git a/modules/lemonldap-ng-manager/t/Lemonldap-NG-Manager_fr.t b/modules/lemonldap-ng-manager/t/Lemonldap-NG-Manager_fr.t index d2d658392..8310045f4 100644 --- a/modules/lemonldap-ng-manager/t/Lemonldap-NG-Manager_fr.t +++ b/modules/lemonldap-ng-manager/t/Lemonldap-NG-Manager_fr.t @@ -17,8 +17,9 @@ $ENV{SCRIPT_NAME} = "__SCRIPTNAME__"; $ENV{SCRIPT_FILENAME} = $0; $ENV{HTTP_ACCEPT_LANGUAGE} = "fr"; my $h; -@ARGV = ( "help=groups" ); -ok( $h = new Lemonldap::NG::Manager( +@ARGV = ("help=groups"); +ok( + $h = new Lemonldap::NG::Manager( { configStorage => { type => 'File', @@ -27,7 +28,8 @@ ok( $h = new Lemonldap::NG::Manager( dhtmlXTreeImageLocation => "/imgs/", jsFile => 'example/lemonldap-ng-manager.js', } -)); + ) +); ok( $h->main() ); ok( $h->print_help() ); ok( $h->buildTree() ); diff --git a/modules/lemonldap-ng-portal/t/Lemonldap-NG-Portal-AuthApache.t b/modules/lemonldap-ng-portal/t/Lemonldap-NG-Portal-AuthApache.t index d12c32f73..9805ba7c6 100644 --- a/modules/lemonldap-ng-portal/t/Lemonldap-NG-Portal-AuthApache.t +++ b/modules/lemonldap-ng-portal/t/Lemonldap-NG-Portal-AuthApache.t @@ -6,7 +6,7 @@ # change 'tests => 1' to 'tests => last_test_to_print'; use Test::More tests => 2; -BEGIN { use_ok('Lemonldap::NG::Portal::Simple') }; +BEGIN { use_ok('Lemonldap::NG::Portal::Simple') } ######################### @@ -14,9 +14,13 @@ BEGIN { use_ok('Lemonldap::NG::Portal::Simple') }; # its man page ( perldoc Test::More ) for help writing this test script. my $p; -ok( $p = Lemonldap::NG::Portal::Simple->new( { +ok( + $p = Lemonldap::NG::Portal::Simple->new( + { globalStorage => 'Apache::Session::File', domain => 'example.com', authentication => 'Apache', -} ) ); + } + ) +); diff --git a/modules/lemonldap-ng-portal/t/Lemonldap-NG-Portal-AuthCAS.t b/modules/lemonldap-ng-portal/t/Lemonldap-NG-Portal-AuthCAS.t index bc109d163..e5c4b017e 100644 --- a/modules/lemonldap-ng-portal/t/Lemonldap-NG-Portal-AuthCAS.t +++ b/modules/lemonldap-ng-portal/t/Lemonldap-NG-Portal-AuthCAS.t @@ -16,13 +16,20 @@ use Test::More tests => 2; # not run. SKIP: { eval { require AuthCAS }; - skip "AuthCAS is not installed, so Lemonldap::NG::Portal::AuthCAS will not be useable", 1 if($@); + skip +"AuthCAS is not installed, so Lemonldap::NG::Portal::AuthCAS will not be useable", + 1 + if ($@); use_ok('Lemonldap::NG::Portal::Simple'); my $p; - ok( $p = Lemonldap::NG::Portal::Simple->new( { + ok( + $p = Lemonldap::NG::Portal::Simple->new( + { globalStorage => 'Apache::Session::File', domain => 'example.com', authentication => 'CAS', - } ) ); + } + ) + ); } diff --git a/modules/lemonldap-ng-portal/t/Lemonldap-NG-Portal-AuthLA.t b/modules/lemonldap-ng-portal/t/Lemonldap-NG-Portal-AuthLA.t index 3c3e29912..350a40eac 100644 --- a/modules/lemonldap-ng-portal/t/Lemonldap-NG-Portal-AuthLA.t +++ b/modules/lemonldap-ng-portal/t/Lemonldap-NG-Portal-AuthLA.t @@ -6,11 +6,15 @@ # change 'tests => 1' to 'tests => last_test_to_print'; use Test::More tests => 1; + # SOAP::Lite is not required, so Lemonldap::NG::Manager::Conf::SOAP may # not run. SKIP: { eval { require lasso }; - skip "lasso is not installed, so Lemonldap::NG::Portal::AuthLA will not be useable", 1 if($@); + skip +"lasso is not installed, so Lemonldap::NG::Portal::AuthLA will not be useable", + 1 + if ($@); use_ok('Lemonldap::NG::Portal::AuthLA'); } diff --git a/modules/lemonldap-ng-portal/t/Lemonldap-NG-Portal-AuthSSL.t b/modules/lemonldap-ng-portal/t/Lemonldap-NG-Portal-AuthSSL.t index 6d7d4800d..6cd350246 100644 --- a/modules/lemonldap-ng-portal/t/Lemonldap-NG-Portal-AuthSSL.t +++ b/modules/lemonldap-ng-portal/t/Lemonldap-NG-Portal-AuthSSL.t @@ -6,7 +6,7 @@ # change 'tests => 1' to 'tests => last_test_to_print'; use Test::More tests => 2; -BEGIN { use_ok('Lemonldap::NG::Portal::Simple') }; +BEGIN { use_ok('Lemonldap::NG::Portal::Simple') } ######################### @@ -14,9 +14,13 @@ BEGIN { use_ok('Lemonldap::NG::Portal::Simple') }; # its man page ( perldoc Test::More ) for help writing this test script. my $p; -ok( $p = Lemonldap::NG::Portal::Simple->new( { +ok( + $p = Lemonldap::NG::Portal::Simple->new( + { globalStorage => 'Apache::Session::File', domain => 'example.com', authentication => 'SSL', -} ) ); + } + ) +); diff --git a/modules/lemonldap-ng-portal/t/Lemonldap-NG-Portal-CDA.t b/modules/lemonldap-ng-portal/t/Lemonldap-NG-Portal-CDA.t index ef8a02011..d1b5cfd49 100644 --- a/modules/lemonldap-ng-portal/t/Lemonldap-NG-Portal-CDA.t +++ b/modules/lemonldap-ng-portal/t/Lemonldap-NG-Portal-CDA.t @@ -6,7 +6,7 @@ # change 'tests => 1' to 'tests => last_test_to_print'; use Test::More tests => 1; -BEGIN { use_ok('Lemonldap::NG::Portal::CDA') }; +BEGIN { use_ok('Lemonldap::NG::Portal::CDA') } ######################### diff --git a/modules/lemonldap-ng-portal/t/Lemonldap-NG-Portal-SharedConf.t b/modules/lemonldap-ng-portal/t/Lemonldap-NG-Portal-SharedConf.t index 0645c177a..cc628b58a 100644 --- a/modules/lemonldap-ng-portal/t/Lemonldap-NG-Portal-SharedConf.t +++ b/modules/lemonldap-ng-portal/t/Lemonldap-NG-Portal-SharedConf.t @@ -6,7 +6,7 @@ # change 'tests => 1' to 'tests => last_test_to_print'; use Test::More tests => 3; -BEGIN { use_ok('Lemonldap::NG::Portal::SharedConf') }; +BEGIN { use_ok('Lemonldap::NG::Portal::SharedConf') } ######################### @@ -14,6 +14,6 @@ BEGIN { use_ok('Lemonldap::NG::Portal::SharedConf') }; # its man page ( perldoc Test::More ) for help writing this test script. my $p = bless {}, 'Lemonldap::NG::Portal::SharedConf'; -ok( ! $p->scanexpr ( '1 == 0' ) ); -ok( $p->scanexpr ( '1 == 1' ) ); +ok( !$p->scanexpr('1 == 0') ); +ok( $p->scanexpr('1 == 1') ); diff --git a/modules/lemonldap-ng-portal/t/Lemonldap-NG-Portal-Simple.t b/modules/lemonldap-ng-portal/t/Lemonldap-NG-Portal-Simple.t index a55cb933c..11817faee 100644 --- a/modules/lemonldap-ng-portal/t/Lemonldap-NG-Portal-Simple.t +++ b/modules/lemonldap-ng-portal/t/Lemonldap-NG-Portal-Simple.t @@ -6,7 +6,7 @@ # change 'tests => 1' to 'tests => last_test_to_print'; use Test::More tests => 5; -BEGIN { use_ok('Lemonldap::NG::Portal::Simple', ':all') }; +BEGIN { use_ok( 'Lemonldap::NG::Portal::Simple', ':all' ) } ######################### @@ -14,10 +14,14 @@ BEGIN { use_ok('Lemonldap::NG::Portal::Simple', ':all') }; # its man page ( perldoc Test::More ) for help writing this test script. my $p; -ok( $p = Lemonldap::NG::Portal::Simple->new( { +ok( + $p = Lemonldap::NG::Portal::Simple->new( + { globalStorage => 'Apache::Session::File', domain => 'example.com', -} ) ); + } + ) +); ok( $p->process == 0 ); ok( $p->{error} == PE_FIRSTACCESS ); diff --git a/modules/lemonldap-ng-portal/t/Lemonldap-NG-Portal-i18n.t b/modules/lemonldap-ng-portal/t/Lemonldap-NG-Portal-i18n.t index 8a7f48f48..cfae09c1a 100644 --- a/modules/lemonldap-ng-portal/t/Lemonldap-NG-Portal-i18n.t +++ b/modules/lemonldap-ng-portal/t/Lemonldap-NG-Portal-i18n.t @@ -6,7 +6,7 @@ # change 'tests => 1' to 'tests => last_test_to_print'; use Test::More tests => 31; -BEGIN { use_ok('Lemonldap::NG::Portal::Simple', ':all') }; +BEGIN { use_ok( 'Lemonldap::NG::Portal::Simple', ':all' ) } ######################### @@ -15,7 +15,7 @@ BEGIN { use_ok('Lemonldap::NG::Portal::Simple', ':all') }; my $p = bless {}, 'Lemonldap::NG::Portal::Simple'; -foreach my $i (1..10) { +foreach my $i ( 1 .. 10 ) { $p->{error} = $i; ok( $p->error('fr;en') ); ok( $p->error('en') );