Debian Codegraph @

lemonldap-ng-common/t/05-Common-Conf-LDAP.t

raw
1 use warnings;
2
3 # Before `make install' is performed this script should be runnable with
4 # `make test'. After `make install' it should work as `perl Lemonldap-NG-Manager.t'
5
6 #########################
7
8 # change 'tests => 1' to 'tests => last_test_to_print';
9
10 use Test::More tests => 3;
11
12 #########################
13
14 # Insert your test code below, the Test::More module is used here so read
15 # its man page ( perldoc Test::More ) for help writing this test script.
16
17 SKIP: {
18 eval { require Net::LDAP; };
19 skip "Net::LDAP is not installed, skipping tests", 3 if ($@);
20 use_ok('Lemonldap::NG::Common::Conf');
21 my $h;
22 ok(
23 $h = new Lemonldap::NG::Common::Conf( {
24 type => 'LDAP',
25 ldapServer => 'ldap://localhost',
26 ldapConfBase => 'ou=conf,ou=websso,dc=example,dc=com',
27 ldapBindDN => 'cn=admin,dc=example,dc=com',
28 ldapBindPassword => 'secret',
29 }
30 ),
31 "New object"
32 ) or print STDERR "Error reported: " . $Lemonldap::NG::Common::Conf::msg;
33
34 ok( ref($h) and $h->can('getLdapConnection') );
35 }