lemonldap-ng/lemonldap-ng-portal/t/30-Lemonldap-NG-Portal-UserDBNull.t

41 lines
1.1 KiB
Perl
Raw Normal View History

# Before `make install' is performed this script should be runnable with
2010-05-08 17:55:27 +02:00
# `make test'. After `make install' it should work as `perl Lemonldap-NG-Portal-AuthSsl.t'
#########################
# change 'tests => 1' to 'tests => last_test_to_print';
2010-05-08 17:55:27 +02:00
use Test::More tests => 4;
BEGIN { use_ok('Lemonldap::NG::Portal::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.
2010-05-08 17:55:27 +02:00
# Fake ENV
$ENV{"REQUEST_METHOD"} = 'GET';
2010-05-12 06:04:10 +02:00
$ENV{"TEST_STRING"} = 'OK';
$ENV{"REMOTE_ADDR"} = '127.0.0.1';
2010-05-08 17:55:27 +02:00
my $p;
ok(
$p = Lemonldap::NG::Portal::Simple->new(
{
globalStorage => 'Apache::Session::File',
domain => 'example.com',
authentication => 'Null',
userDB => 'Null',
passwordDB => 'Null',
registerDB => 'Null',
exportedVars => { uid => "TEST_STRING", },
2010-05-08 17:55:27 +02:00
}
)
);
2010-05-12 06:04:10 +02:00
ok( $p->setSessionInfo() == PE_OK, 'Run setSessionInfo' );
2010-05-08 17:55:27 +02:00
2010-05-12 06:04:10 +02:00
ok( $p->{sessionInfo}->{"uid"} eq "OK", 'Read info in session' );
2010-05-08 17:55:27 +02:00