From 3a161187eefed8bbbfa46ef76968037e57b44044 Mon Sep 17 00:00:00 2001 From: Lari Taskula Date: Wed, 22 Oct 2025 11:01:00 +0300 Subject: [PATCH] Bug 29326: Add test for _BLANK_ key To test: 1. prove t/db_dependent/Koha/Item.t 2. Observe success --- t/db_dependent/Koha/Item.t | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/t/db_dependent/Koha/Item.t b/t/db_dependent/Koha/Item.t index 19cdb04deac..c64c72e45fb 100755 --- a/t/db_dependent/Koha/Item.t +++ b/t/db_dependent/Koha/Item.t @@ -3356,7 +3356,7 @@ subtest 'current_branchtransfers relationship' => sub { subtest 'location_update_trigger() tests' => sub { - plan tests => 10; + plan tests => 12; $schema->storage->txn_begin; @@ -3394,6 +3394,12 @@ subtest 'location_update_trigger() tests' => sub { $item->location_update_trigger($action); is( $item->location, q{}, q{`_BLANK_` does the job} ); + t::lib::Mocks::mock_preference( $pref, qq{_BLANK_: $location} ); + $item->location('')->store(); + + $item->location_update_trigger($action); + is( $item->location, $location, q{`_BLANK_` as the key does the job} ); + t::lib::Mocks::mock_preference( $pref, qq{GEN: _BLANK_\n_BLANK_: PROC\n$location: _PERM_} ); $item->set( @@ -3874,4 +3880,4 @@ subtest 'effective_bookable() tests' => sub { ); $schema->storage->txn_rollback; -}; +}; \ No newline at end of file -- 2.34.1