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

(-)a/t/db_dependent/sysprefs.t (-8 / +8 lines)
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 => 8;
22
use Test::More tests => 9;
23
use C4::Context;
23
use C4::Context;
24
use Koha::Database;
24
use Koha::Database;
25
25
Lines 53-61 C4::Context->set_preference('testpreference', 'abc'); Link Here
53
C4::Context->delete_preference('testpreference');
53
C4::Context->delete_preference('testpreference');
54
is(C4::Context->preference('testpreference'), undef, 'deleting preferences');
54
is(C4::Context->preference('testpreference'), undef, 'deleting preferences');
55
55
56
C4::Context->set_preference('testpreference', 'def');
56
# Test delete_preference, check cache; we need an example here with MIXED case !
57
# Delete from the database, it should still be in cache
57
C4::Context->enable_syspref_cache;
58
$dbh->do("DELETE FROM systempreferences WHERE variable='testpreference'");
58
C4::Context->set_preference( 'TestPreference', 'def' );
59
is(C4::Context->preference('testpreference'), 'def', 'caching preferences');
59
is( C4::Context->preference('testpreference'), 'def', 'lower case, got right value' );
60
C4::Context->clear_syspref_cache();
60
C4::Context->delete_preference('TestPreference');
61
is(C4::Context->preference('testpreference'), undef, 'clearing preference cache');
61
is( C4::Context->preference('TestPreference'), undef, 'mixed case, cache is cleared' );
62
is( C4::Context->preference('testpreference'), undef, 'lower case, cache is cleared' );
62
- 

Return to bug 36793