Lines 19-25
Link Here
|
19 |
# along with Koha; if not, see <http://www.gnu.org/licenses>. |
19 |
# along with Koha; if not, see <http://www.gnu.org/licenses>. |
20 |
|
20 |
|
21 |
use Modern::Perl; |
21 |
use Modern::Perl; |
22 |
use Test::More tests => 3; |
22 |
use Test::More tests => 4; |
23 |
use C4::Context; |
23 |
use C4::Context; |
24 |
|
24 |
|
25 |
# Start transaction |
25 |
# Start transaction |
Lines 27-46
my $dbh = C4::Context->dbh;
Link Here
|
27 |
$dbh->{RaiseError} = 1; |
27 |
$dbh->{RaiseError} = 1; |
28 |
$dbh->{AutoCommit} = 0; |
28 |
$dbh->{AutoCommit} = 0; |
29 |
|
29 |
|
30 |
my $opacheader = C4::Context->preference('opacheader'); |
30 |
my $opacheader = C4::Context->preference('opacheader'); |
31 |
my $newopacheader = "newopacheader"; |
31 |
my $newopacheader = "newopacheader"; |
32 |
|
32 |
|
33 |
C4::Context->set_preference('OPACHEADER', $newopacheader); |
33 |
C4::Context->set_preference( 'OPACHEADER', $newopacheader ); |
34 |
ok(C4::Context->preference('opacheader') eq $newopacheader); |
34 |
is( C4::Context->preference('opacheader'), $newopacheader ); |
35 |
|
35 |
|
36 |
C4::Context->set_preference('opacheader', $opacheader); |
36 |
C4::Context->set_preference( 'opacheader', $opacheader ); |
37 |
ok(C4::Context->preference('OPACHEADER') eq $opacheader); |
37 |
is( C4::Context->preference('OPACHEADER'), $opacheader ); |
38 |
|
38 |
|
39 |
$ENV{OVERRIDE_SYSPREF_opacheader} = 'this is an override'; |
39 |
$ENV{OVERRIDE_SYSPREF_opacheader} = 'this is an override'; |
40 |
C4::Context->clear_syspref_cache(); |
40 |
C4::Context->clear_syspref_cache(); |
41 |
is(C4::Context->preference('opacheader'), |
41 |
is( |
42 |
'this is an override', |
42 |
C4::Context->preference('opacheader'), |
43 |
'system preference value overridden from environment' |
43 |
'this is an override', |
|
|
44 |
'system preference value overridden from environment' |
44 |
); |
45 |
); |
45 |
|
46 |
|
46 |
$dbh->rollback; |
47 |
C4::Context->set_preference( 'IDoNotExist', 'NonExistent' ); |
|
|
48 |
is( C4::Context->preference('IDoNotExist'), 'NonExistent', 'Test creation of non-existant system preferencer' ); |
47 |
- |
|
|