test suite - various changes
[koha.git] / t / override_context_prefs.pm
1 use strict;
2 use warnings;
3
4 # This stub module is used to override
5 # the C4::Context sub preference for the 
6 # purpose of the test suite.  This allows
7 # non-DB-dependent tests of most modules,
8 # particularly the ones that include C4::Dates.
9
10 use C4::Context;
11
12 package C4::Context;
13 no warnings;
14 sub preference {
15     my $self = shift;
16     my $pref = shift;
17     return 'us'           if $pref eq 'dateformat';
18     return 'MARC21'       if $pref eq 'marcflavour';
19     return 'Test Library' if $pref eq 'LibraryName';
20     return;
21 }
22
23 1;