# 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 => 11; use IO::String; use strict; 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; our $buf; tie *STDOUT, 'IO::String', $buf; our $lastpos = 0; sub diff { my $str = $buf; $str =~ s/^.{$lastpos}//s if ($lastpos); $str =~ s/\r//gs; $lastpos = length $buf; return $str; } @ARGV = ("help=groups"); ok( $h = new Lemonldap::NG::Manager( { 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() =~ /main() and diff() =~ m#