2007-02-24 21:23:17 +01:00
|
|
|
# Before `make install' is performed this script should be runnable with
|
|
|
|
# `make test'. After `make install' it should work as `perl Lemonldap-NG-Manager.t'
|
|
|
|
|
|
|
|
#########################
|
|
|
|
|
|
|
|
# change 'tests => 1' to 'tests => last_test_to_print';
|
|
|
|
|
2007-05-15 20:06:24 +02:00
|
|
|
use Test::More tests => 3;
|
2008-11-17 17:59:56 +01:00
|
|
|
BEGIN { use_ok('Lemonldap::NG::Common::Conf') }
|
2007-02-24 21:23:17 +01:00
|
|
|
|
|
|
|
#########################
|
|
|
|
|
|
|
|
# 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.
|
|
|
|
|
2007-05-06 16:41:30 +02:00
|
|
|
my $h;
|
2010-04-30 07:27:06 +02:00
|
|
|
my $inifile = "lemonldap-ng.ini";
|
2009-12-02 16:08:35 +01:00
|
|
|
my $confsection = "configuration";
|
2008-12-26 17:13:36 +01:00
|
|
|
|
2007-05-06 16:41:30 +02:00
|
|
|
ok(
|
2008-12-26 17:13:36 +01:00
|
|
|
(
|
|
|
|
Lemonldap::NG::Common::Conf->new( type => 'bad' ) == 0
|
|
|
|
and $Lemonldap::NG::Common::Conf::msg =~
|
2010-03-10 08:59:31 +01:00
|
|
|
/Error: Unknown package Lemonldap::NG::Common::Conf::bad\.$/
|
2008-12-26 17:13:36 +01:00
|
|
|
),
|
|
|
|
'Bad module'
|
2007-05-06 16:41:30 +02:00
|
|
|
);
|
2007-05-15 20:06:24 +02:00
|
|
|
|
2008-12-26 17:13:36 +01:00
|
|
|
$h = bless {}, 'Lemonldap::NG::Common::Conf';
|
|
|
|
|
2010-04-30 07:27:06 +02:00
|
|
|
ok(
|
2009-12-02 16:08:35 +01:00
|
|
|
(
|
2010-04-30 07:27:06 +02:00
|
|
|
%$h = ( %$h, %{ $h->getLocalConf( $confsection, $inifile, 0 ) } )
|
|
|
|
and exists $h->{localStorage}
|
2009-12-02 16:08:35 +01:00
|
|
|
),
|
|
|
|
"Read $inifile"
|
|
|
|
);
|
2008-12-26 17:13:36 +01:00
|
|
|
|