View | Details | Raw Unified | Return to bug 11998
Collapse All | Expand All

(-)a/t/db_dependent/Context.t (-3 / +2 lines)
Lines 53-59 $module->mock( Link Here
53
);
53
);
54
54
55
my $history;
55
my $history;
56
C4::Context->disable_syspref_cache();
57
$dbh = C4::Context->dbh({ new => 1 });
56
$dbh = C4::Context->dbh({ new => 1 });
58
57
59
$dbh->{mock_add_resultset} = [ ['value'], ['thing1'] ];
58
$dbh->{mock_add_resultset} = [ ['value'], ['thing1'] ];
Lines 82-88 is(scalar(@{$history}), 1, 'Retrieved syspref from database'); Link Here
82
81
83
C4::Context->enable_syspref_cache();
82
C4::Context->enable_syspref_cache();
84
$dbh->{mock_clear_history} = 1;
83
$dbh->{mock_clear_history} = 1;
85
is(C4::Context->preference("SillyPreference"), 'thing3', "Retrieved syspref (value='thing3') successfully from cache");
84
# This gives us the value that was cached on the first call, when the cache was active.
85
is(C4::Context->preference("SillyPreference"), 'thing1', "Retrieved syspref (value='thing1') successfully from cache");
86
$history = $dbh->{mock_all_history};
86
$history = $dbh->{mock_all_history};
87
is(scalar(@{$history}), 0, 'Did not retrieve syspref from database');
87
is(scalar(@{$history}), 0, 'Did not retrieve syspref from database');
88
88
89
- 

Return to bug 11998