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> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de> (cherry picked from commitb77cb006f1
) Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com> (cherry picked from commitd39200e0d6
) Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
parent
4260a97d6b
commit
eb7d259dd0
1 changed files with 8 additions and 7 deletions
|
@ -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' );
|
||||
|
|
Loading…
Reference in a new issue