From 9ca01ea78fa2857e703088321a456225f9f986e2 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 16 Jul 2025 11:44:10 +0200 Subject: [PATCH] Bug 40405: [DO NOT PUSH] Show the problem with C4::Context->set_preference Apply this patch before the others and notice the failure. --- t/db_dependent/sysprefs.t | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/t/db_dependent/sysprefs.t b/t/db_dependent/sysprefs.t index 634c09f8f7d..bfc0efb5acf 100755 --- a/t/db_dependent/sysprefs.t +++ b/t/db_dependent/sysprefs.t @@ -20,7 +20,7 @@ use Modern::Perl; use Test::NoWarnings; -use Test::More tests => 10; +use Test::More tests => 12; use C4::Context; use Koha::Database; @@ -54,6 +54,11 @@ C4::Context->set_preference( 'testpreference', 'abc' ); C4::Context->delete_preference('testpreference'); is( C4::Context->preference('testpreference'), undef, 'deleting preferences' ); +C4::Context->set_preference( 'testpreference', 'abc' ); +is( C4::Context->preference('testpreference'), 'abc', 'testpreference set to abc' ); +C4::Context->set_preference( 'testpreference', undef ); +is( C4::Context->preference('testpreference'), undef, 'deleting preferences' ); + # Test delete_preference, check cache; we need an example here with MIXED case ! C4::Context->enable_syspref_cache; C4::Context->set_preference( 'TestPreference', 'def' ); -- 2.34.1