# 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; 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 => ".", }, dhtmlXTreeImageLocation => "/imgs/", 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() ); my $tmp = &xml; ok( ref( $h->tree2conf( \$tmp ) ) ); sub xml { return << 'EOF'; Configuration 9 Paramtres gnraux Paramtres d'authentification Type d'authentification ldap Portail http://auth.example.com/ Cookie scuris (SSL) 0 Nom du cookie lemonldap Domaine example.com Attributs LDAP exporter cn cn mail mail uid uid Paramtres LDAP Base de recherche LDAP dc=gendarmerie,dc=defense,dc=gouv,dc=fr Port du serveur LDAP 389 Serveur LDAP localhost Compte de connexion LDAP Mot de passe LDAP Macros undefined Stockage des sessions Module Apache::Session Apache::Session::File Paramtres du module Apache::Session Directory /tmp Groupes d'utilisateurs undefined Htes virtuels auth.example.com En-ttes HTTP Auth-User $uid Rgles default accept test.example.com En-ttes HTTP Auth-User $uid Rgles test=no deny default accept EOF }