Commit 305c6a8c authored by Xavier Guimard's avatar Xavier Guimard

LEMONLDAP::NG : More tests in Lemonldap::NG::Manager

parent 6f67668b
......@@ -4,7 +4,7 @@ use strict;
use Lemonldap::NG::Handler::SharedConf qw(:all);
our $VERSION = '0.01';
our $VERSION = '0.02';
our @ISA = qw(Lemonldap::NG::Handler::SharedConf);
......@@ -15,7 +15,7 @@ sub run ($$) {
my $class;
( $class, $apacheRequest ) = @_;
my $args = $apacheRequest->args;
if ( $args =~ s/\??($cookieName=\w+)$//oi ) {
if ( $args =~ s/[\?&]?($cookieName=\w+)$//oi ) {
my $str = $1;
$class->lmLog(
"Found a CDA id. Redirecting "
......
......@@ -69,6 +69,8 @@ README
scripts/lmConfig_File2MySQL
TODO
t/Lemonldap-NG-Manager.t
t/Lemonldap-NG-Manager_en.t
t/Lemonldap-NG-Manager_fr.t
t/Lemonldap-NG-Manager-Conf.t
t/Lemonldap-NG-Manager-Conf-DBI.t
t/Lemonldap-NG-Manager-Conf-File.t
......
......@@ -5,11 +5,35 @@
# change 'tests => 1' to 'tests => last_test_to_print';
use Test::More tests => 1;
BEGIN { use_ok('Lemonldap::NG::Manager') };
use Test::More tests => 10;
BEGIN { use_ok('Lemonldap::NG::Manager') }
#########################
# 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.
$ENV{SCRIPT_NAME} = "__SCRIPTNAME__";
$ENV{SCRIPT_FILENAME} = $0;
my $h;
@ARGV = ( "help=groups" );
ok( $h = new Lemonldap::NG::Manager(
{
configStorage => {
type => 'File',
dirName => "/tmp/",
},
dhtmlXTreeImageLocation => "/imgs/",
applyConfFile => '__DIR__/manager/apply.conf',
jsFile => 'example/lemonldap-ng-manager.js',
}
));
ok( $h->header_public() );
ok( $h->start_html() );
ok( $h->main() );
ok( $h->end_html() );
ok( $h->print_css() );
ok( $h->print_lmjs() );
ok( $h->print_help() );
ok( $h->buildTree() );
# 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';
use Test::More tests => 5;
BEGIN { use_ok('Lemonldap::NG::Manager') }
#########################
# 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.
$ENV{SCRIPT_NAME} = "__SCRIPTNAME__";
$ENV{SCRIPT_FILENAME} = $0;
$ENV{HTTP_ACCEPT_LANGUAGE} = "en";
my $h;
@ARGV = ( "help=groups" );
ok( $h = new Lemonldap::NG::Manager(
{
configStorage => {
type => 'File',
dirName => "/tmp/",
},
dhtmlXTreeImageLocation => "/imgs/",
applyConfFile => '__DIR__/manager/apply.conf',
jsFile => 'example/lemonldap-ng-manager.js',
}
));
ok( $h->main() );
ok( $h->print_help() );
ok( $h->buildTree() );
# 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';
use Test::More tests => 5;
BEGIN { use_ok('Lemonldap::NG::Manager') }
#########################
# 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.
$ENV{SCRIPT_NAME} = "__SCRIPTNAME__";
$ENV{SCRIPT_FILENAME} = $0;
$ENV{HTTP_ACCEPT_LANGUAGE} = "fr";
my $h;
@ARGV = ( "help=groups" );
ok( $h = new Lemonldap::NG::Manager(
{
configStorage => {
type => 'File',
dirName => "/tmp/",
},
dhtmlXTreeImageLocation => "/imgs/",
applyConfFile => '__DIR__/manager/apply.conf',
jsFile => 'example/lemonldap-ng-manager.js',
}
));
ok( $h->main() );
ok( $h->print_help() );
ok( $h->buildTree() );
......@@ -49,7 +49,7 @@ With Lemonldap::NG::Portal::Simple:
use Lemonldap::NG::Portal::Simple;
my $portal = new Lemonldap::NG::Portal::Simple(
domain => 'gendarmerie.defense.gouv.fr',
domain => 'example.com',
globalStorage => 'Apache::Session::MySQL',
globalStorageOptions => {
DataSource => 'dbi:mysql:database',
......
......@@ -441,7 +441,7 @@ Lemonldap::NG::Portal::Simple - Base module for building Lemonldap::NG compatibl
use Lemonldap::NG::Portal::Simple;
my $portal = new Lemonldap::NG::Portal::Simple(
domain => 'gendarmerie.defense.gouv.fr',
domain => 'example.com',
globalStorage => 'Apache::Session::MySQL',
globalStorageOptions => {
DataSource => 'dbi:mysql:database=dbname;host=127.0.0.1',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment