Bugzilla – Attachment 166753 Details for
Bug 36793
Local preferences should not stay in the cache when they are deleted
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 36793: Unit test
Bug-36793-Unit-test.patch (text/plain), 1.93 KB, created by
Martin Renvoize (ashimema)
on 2024-05-15 08:33:27 UTC
(
hide
)
Description:
Bug 36793: Unit test
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2024-05-15 08:33:27 UTC
Size:
1.93 KB
patch
obsolete
>From 6f04c5ff179948b232e676926194c87c5e3711df Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Mon, 6 May 2024 12:28:45 +0000 >Subject: [PATCH] Bug 36793: Unit test > >This only applies to 'local' preferences. > >Test plan: >Run sysprefs.t with/without second patch. > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > t/db_dependent/sysprefs.t | 15 ++++++++------- > 1 file changed, 8 insertions(+), 7 deletions(-) > >diff --git a/t/db_dependent/sysprefs.t b/t/db_dependent/sysprefs.t >index f43f8e3d665..f214bc77199 100755 >--- a/t/db_dependent/sysprefs.t >+++ b/t/db_dependent/sysprefs.t >@@ -19,7 +19,7 @@ > # along with Koha; if not, see <http://www.gnu.org/licenses>. > > use Modern::Perl; >-use Test::More tests => 8; >+use Test::More tests => 9; > use C4::Context; > use Koha::Database; > >@@ -53,9 +53,10 @@ C4::Context->set_preference('testpreference', 'abc'); > C4::Context->delete_preference('testpreference'); > is(C4::Context->preference('testpreference'), undef, 'deleting preferences'); > >-C4::Context->set_preference('testpreference', 'def'); >-# Delete from the database, it should still be in cache >-$dbh->do("DELETE FROM systempreferences WHERE variable='testpreference'"); >-is(C4::Context->preference('testpreference'), 'def', 'caching preferences'); >-C4::Context->clear_syspref_cache(); >-is(C4::Context->preference('testpreference'), undef, 'clearing preference cache'); >+# Test delete_preference, check cache; we need an example here with MIXED case ! >+C4::Context->enable_syspref_cache; >+C4::Context->set_preference( 'TestPreference', 'def' ); >+is( C4::Context->preference('testpreference'), 'def', 'lower case, got right value' ); >+C4::Context->delete_preference('TestPreference'); >+is( C4::Context->preference('TestPreference'), undef, 'mixed case, cache is cleared' ); >+is( C4::Context->preference('testpreference'), undef, 'lower case, cache is cleared' ); >-- >2.45.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 36793
:
166222
|
166223
| 166753 |
166754