From c4b9635c53a6aa59e8614bc40193e0a48ba768be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Oudot?= Date: Sat, 24 May 2014 18:23:34 +0000 Subject: [PATCH] Fix some tests after recent modifications on Handler --- debian/liblemonldap-ng-handler-perl.examples | 1 - debian/liblemonldap-ng-handler-perl.postinst | 9 ----- lemonldap-ng-handler/MANIFEST | 5 --- .../t/02-Lemonldap-NG-Handler-Main-Portal.t | 34 ++++++++----------- .../t/10-Lemonldap-NG-Handler-SharedConf.t | 4 +-- .../t/51-Lemonldap-NG-Handler-Zimbra.t | 4 ++- 6 files changed, 20 insertions(+), 37 deletions(-) diff --git a/debian/liblemonldap-ng-handler-perl.examples b/debian/liblemonldap-ng-handler-perl.examples index cd7f90c86..52a5b8d69 100644 --- a/debian/liblemonldap-ng-handler-perl.examples +++ b/debian/liblemonldap-ng-handler-perl.examples @@ -1,4 +1,3 @@ -debian/tmp/examples/handler/* debian/tmp/etc/lemonldap-ng/handler-apache2.conf debian/tmp/etc/lemonldap-ng/test-apache2.conf debian/tmp/var/lib/lemonldap-ng/test diff --git a/debian/liblemonldap-ng-handler-perl.postinst b/debian/liblemonldap-ng-handler-perl.postinst index 35de0f29a..3d5ea1899 100644 --- a/debian/liblemonldap-ng-handler-perl.postinst +++ b/debian/liblemonldap-ng-handler-perl.postinst @@ -4,14 +4,5 @@ set -e . /usr/share/debconf/confmodule -EXAMPLEHANDLERFILE=/usr/share/doc/liblemonldap-ng-handler-perl/examples/MyHandler.pm -HANDLERFILE=/var/lib/lemonldap-ng/handler/MyHandler.pm -SESSIONSDIR=/var/lib/lemonldap-ng/sessions - -if [ "$1" == "configure" ] -then - [ -e $HANDLERFILE ] || cp $EXAMPLEHANDLERFILE $HANDLERFILE -fi - #DEBHELPER# exit 0 diff --git a/lemonldap-ng-handler/MANIFEST b/lemonldap-ng-handler/MANIFEST index 66617a868..a24843523 100644 --- a/lemonldap-ng-handler/MANIFEST +++ b/lemonldap-ng-handler/MANIFEST @@ -5,7 +5,6 @@ example/MyHandlerLog4Perl.pm example/scripts/purgeLocalCache example/scripts/purgeLocalCache.cron.d lib/Lemonldap/NG/Handler.pm -lib/Lemonldap/NG/Handler/AuthBasic.pm lib/Lemonldap/NG/Handler/CGI.pm lib/Lemonldap/NG/Handler/SharedConf.pm lib/Lemonldap/NG/Handler/Initialization/GlobalInit.pm @@ -17,16 +16,12 @@ lib/Lemonldap/NG/Handler/Main/Logger.pm lib/Lemonldap/NG/Handler/Main/PostForm.pm lib/Lemonldap/NG/Handler/Menu.pm lib/Lemonldap/NG/Handler/Proxy.pm -lib/Lemonldap/NG/Handler/SecureToken.pm lib/Lemonldap/NG/Handler/Specific/AuthBasic.pm lib/Lemonldap/NG/Handler/Specific/SecureToken.pm lib/Lemonldap/NG/Handler/Specific/SympaAutoLogin.pm lib/Lemonldap/NG/Handler/Specific/UpdateCookie.pm lib/Lemonldap/NG/Handler/Specific/ZimbraPreAuth.pm lib/Lemonldap/NG/Handler/Status.pm -lib/Lemonldap/NG/Handler/SympaAutoLogin.pm -lib/Lemonldap/NG/Handler/UpdateCookie.pm -lib/Lemonldap/NG/Handler/ZimbraPreAuth.pm Makefile.PL MANIFEST This list of files META.yml diff --git a/lemonldap-ng-handler/t/02-Lemonldap-NG-Handler-Main-Portal.t b/lemonldap-ng-handler/t/02-Lemonldap-NG-Handler-Main-Portal.t index 7854fca02..d2682f7da 100644 --- a/lemonldap-ng-handler/t/02-Lemonldap-NG-Handler-Main-Portal.t +++ b/lemonldap-ng-handler/t/02-Lemonldap-NG-Handler-Main-Portal.t @@ -4,29 +4,25 @@ ########################## # ## change 'tests => 1' to 'tests => last_test_to_print'; -#no warnings; -#use Test::More; #qw(no_plan) -# -#my $numTests = 2; -#eval { require Test::MockObject } -# or { $numTests = 1 -# and warn "Warning: Test::MockObject is needed to run deeper tests\n" }; -# -#plan tests => $numTests; -# -## get a standard basic configuration in $args hashref -#use Cwd 'abs_path'; -#use File::Basename; -#use lib dirname( abs_path $0 ); -# -#open STDERR, '>/dev/null'; -# +no warnings; +use Test::More; #qw(no_plan) + +my $numTests = 1; +plan tests => $numTests; + +# get a standard basic configuration in $args hashref +use Cwd 'abs_path'; +use File::Basename; +use lib dirname( abs_path $0 ); + +open STDERR, '>/dev/null'; + ########################## # ## 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. -#use_ok( 'Lemonldap::NG::Handler::Main', ':all' ); -# +use_ok( 'Lemonldap::NG::Handler::Main', ':all' ); + #if ( $numTests == 2 ) { # my $h; # $h = bless {}, 'Lemonldap::NG::Handler::Main'; diff --git a/lemonldap-ng-handler/t/10-Lemonldap-NG-Handler-SharedConf.t b/lemonldap-ng-handler/t/10-Lemonldap-NG-Handler-SharedConf.t index 58f9d8bb5..f322c16c0 100644 --- a/lemonldap-ng-handler/t/10-Lemonldap-NG-Handler-SharedConf.t +++ b/lemonldap-ng-handler/t/10-Lemonldap-NG-Handler-SharedConf.t @@ -76,8 +76,8 @@ if ( $numTests == 3 ) { unescape_url => sub { return $_ }, ); my $ret; - $mock->fake_module( 'Lemonldap::NG::Handler::Main::Headers', - lmSetHeaderOut => sub { $ret = join( ':', $_[2], $_[3], ); }, ); + $mock->fake_module( 'Lemonldap::NG::Handler::API', + set_header_out => sub { $ret = join( ':', $_[2], $_[3], ); }, ); our $apacheRequest = Apache2::RequestRec->new(); diff --git a/lemonldap-ng-handler/t/51-Lemonldap-NG-Handler-Zimbra.t b/lemonldap-ng-handler/t/51-Lemonldap-NG-Handler-Zimbra.t index 0bc6f3694..f2180e3b2 100644 --- a/lemonldap-ng-handler/t/51-Lemonldap-NG-Handler-Zimbra.t +++ b/lemonldap-ng-handler/t/51-Lemonldap-NG-Handler-Zimbra.t @@ -25,6 +25,8 @@ $ini->flush(); use Env qw(LLNG_DEFAULTCONFFILE); $LLNG_DEFAULTCONFFILE = $ini->filename; +open STDERR, '>/dev/null'; + ######################### # Insert your test code below, the Test::More module is use()ed here so read @@ -35,7 +37,7 @@ SKIP: { "Digest::HMAC_SHA1 is not installed, so Lemonldap::NG::Handler::ZimbraPreAuth will not be useable", 1 if ($@); - use_ok('Lemonldap::NG::Handler::ZimbraPreAuth'); + use_ok('Lemonldap::NG::Handler::Specific::ZimbraPreAuth'); } $LLNG_DEFAULTCONFFILE = undef;