environments/ppa-mbqj77/deployments/1
Xavier Guimard 16 years ago
parent 8451736ded
commit ee3fc975e0
  1. 2
      modules/lemonldap-ng-common/t/20-Common-CGI.t
  2. 1
      modules/lemonldap-ng-manager/META.yml
  3. 5
      modules/lemonldap-ng-manager/Makefile.PL
  4. 53
      modules/lemonldap-ng-manager/t/10-Manager.t

@ -39,7 +39,7 @@ $ENV{QUERY_STRING} = '';
ok( $buf = $cgi->header_public('t/20-Common-CGI.t'), 'header_public' );
ok( $buf =~ /Cache-control: public; must-revalidate; max-age=\d+\r?\n/s,
'Cache-Control' );
ok( $buf =~ /Last-modified: /, 'Last-Modified' );
ok( $buf =~ /Last-modified: /s, 'Last-Modified' );
# Test _sub mechanism
ok( $cgi->_sub('subtest') eq 'OK1', '_sub mechanism 1' );

@ -9,6 +9,7 @@ generated_by: ExtUtils::MakeMaker version 6.42
distribution_type: module
requires:
CGI: 3.08
IO::String: 0
Lemonldap::NG::Common: 0.9
Lemonldap::NG::Handler: 0.9
LWP::UserAgent: 0

@ -7,10 +7,11 @@ WriteMakefile(
VERSION_FROM => 'lib/Lemonldap/NG/Manager.pm', # finds $VERSION
PREREQ_PM => {
'CGI' => 3.08,
'XML::Simple' => 0,
'LWP::UserAgent' => 0,
'IO::String' => 0,
'Lemonldap::NG::Common' => 0.9,
'Lemonldap::NG::Handler' => 0.9,
'LWP::UserAgent' => 0,
'XML::Simple' => 0,
}, # e.g., Module::Name => 1.1
(
$] >= 5.005

@ -6,6 +6,7 @@
# change 'tests => 1' to 'tests => last_test_to_print';
use Test::More tests => 11;
use IO::String;
BEGIN { use_ok('Lemonldap::NG::Manager') }
#########################
@ -13,32 +14,44 @@ 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{SCRIPT_NAME} = "__SCRIPTNAME__";
$ENV{SCRIPT_FILENAME} = $0;
my $h;
our $buf;
tie *STDOUT, 'IO::String', $buf;
@ARGV = ("help=groups");
ok(
$h = new Lemonldap::NG::Manager(
{
configStorage => {
type => 'File',
dirName => ".",
},
dhtmlXTreeImageLocation => "/imgs/",
jsFile => 'example/lemonldap-ng-manager.js',
}
)
{
configStorage => {
type => 'File',
dirName => ".",
},
dhtmlXTreeImageLocation => "/imgs/",
jsFile => 'example/lemonldap-ng-manager.js',
}
),
'New object'
);
ok( $h->header_public('example/index.pl') =~ /Cache-control:\s+public/s,
'header_public' );
ok( $h->start_html() =~ /<html/s, 'start_html' );
ok( ( $h->main() and $buf =~ m#<script type="text/javascript"# ), 'main' );
ok( $h->end_html() =~ m#</html>#, 'end_html' );
ok( ( $h->print_css() and $buf =~ /Cache-control:\s+public/s ), 'css' );
ok(
(
$h->print_lmjs()
and $buf =~ /Cache-control:\s+public.*Cache-control:\s+public/s
),
'javascript'
);
ok( $h->header_public('example/index.pl') );
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() );
ok( $h->print_help(), 'help' );
ok( ref( $h->buildTree() ) eq 'HASH', 'buildTree' );
my $tmp = &xml;
ok( ref( $h->tree2conf( \$tmp ) ) );
ok( ref( $h->tree2conf( \$tmp ) ), 'tree2conf' );
sub xml {
return << 'EOF';

Loading…
Cancel
Save