koha-news.tmpl - Cancel button still referenced "opac-news" instead of "koha-news"
[koha.git] / t / Auth.t
blob1cacb3195db8a768a6f2e316620247cd1d2fb9cc
1 #!/usr/bin/perl
3 # This Koha test module is a stub!
4 # Add more tests here!!!
6 use strict;
7 use warnings;
9 use Test::More tests => 6;
11 BEGIN {
12 use_ok('C4::Auth', qw(checkpw));
13 use_ok('C4::Context');
16 use vars qw($dbh $ldap);
17 can_ok('C4::Context', 'config');
18 can_ok('C4::Context', 'dbh');
19 can_ok('C4::Auth', qw(checkpw));
20 ok($dbh = C4::Context->dbh(), "Getting dbh from C4::Context");
21 $ldap = C4::Context->config('useldapserver') || 0;
22 diag("Using LDAP? $ldap");
24 while (1) { # forever!
25 print "Do you want to test further accounts? (If not, just hit return.)\n";
26 my ($user, $pass);
27 print "Enter username: ";
28 chomp($user = <>);
29 ($user) or exit;
30 print "Enter password: ";
31 chomp($pass = <>);
32 my ($retval,$retcard) = checkpw($dbh,$user,$pass);
33 $retval ||= '';
34 $retcard ||= '';
35 diag ("checkpw(\$dbh,$user,$pass) " . ($retval ? 'SUCCEEDS' : ' FAILS ') . "\treturns ($retval,$retcard)");
38 END {
39 diag("C4::Auth - end of test");
41 __END__