3 # This file is part of Koha.
5 # Copyright (C) 2012 BibLibre SARL
6 # Copyright (C) 2013 Equinox Software, Inc.
8 # Koha is free software; you can redistribute it and/or modify it
9 # under the terms of the GNU General Public License as published by
10 # the Free Software Foundation; either version 3 of the License, or
11 # (at your option) any later version.
13 # Koha is distributed in the hope that it will be useful, but
14 # WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 # GNU General Public License for more details.
18 # You should have received a copy of the GNU General Public License
19 # along with Koha; if not, see <http://www.gnu.org/licenses>.
22 use Test
::More tests
=> 3;
26 my $dbh = C4
::Context
->dbh;
27 $dbh->{RaiseError
} = 1;
28 $dbh->{AutoCommit
} = 0;
30 my $opacheader = C4
::Context
->preference('opacheader');
31 my $newopacheader = "newopacheader";
33 C4
::Context
->set_preference('OPACHEADER', $newopacheader);
34 ok
(C4
::Context
->preference('opacheader') eq $newopacheader);
36 C4
::Context
->set_preference('opacheader', $opacheader);
37 ok
(C4
::Context
->preference('OPACHEADER') eq $opacheader);
39 $ENV{OVERRIDE_SYSPREF_opacheader
} = 'this is an override';
40 C4
::Context
->clear_syspref_cache();
41 is
(C4
::Context
->preference('opacheader'),
42 'this is an override',
43 'system preference value overridden from environment'