Bug 13400: Untranslatable "Are you sure you want to delete this authority?"
[koha.git] / t / db_dependent / Log.t
blob8a25c18a5aab0672ff33ab1b8612343a805b507c
1 #!/usr/bin/perl
3 # Copyright 2011 MJ Ray and software.coop
4 # This Koha test module is a stub!
5 # Add more tests here!!!
7 use strict;
8 use warnings;
9 use Test::More tests => 5;
11 # We need C4::Dates to handle the dates
12 use C4::Dates;
14 BEGIN {
15 use_ok('C4::Log');
17 my $success;
19 eval {
20 # FIXME: are we sure there is an member number 1?
21 # FIXME: can we remove this log entry somehow?
22 logaction("MEMBERS","MODIFY",1,"test operation");
23 $success = 1;
24 } or do {
25 diag($@);
26 $success = 0;
28 ok($success, "logaction seemed to work");
30 eval {
31 # FIXME: US formatted date hardcoded into test for now
32 $success = scalar(@{GetLogs("","","",undef,undef,"","")});
33 } or do {
34 diag($@);
35 $success = 0;
37 ok($success, "GetLogs returns results for an open search");
39 eval {
40 # FIXME: US formatted date hardcoded into test for now
41 my $date = C4::Dates->new();
42 $success = scalar(@{GetLogs($date->today(),$date->today(),"",undef,undef,"","")});
43 } or do {
44 diag($@);
45 $success = 0;
47 ok($success, "GetLogs accepts dates in an All-matching search");
49 eval {
50 $success = scalar(@{GetLogs("","","",["MEMBERS"],["MODIFY"],1,"")});
51 } or do {
52 diag($@);
53 $success = 0;
55 ok($success, "GetLogs seemed to find ".$success." like our test record in a tighter search");