From 06254860a18af8b1e5aac0db4786b731a21a7438 Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Wed, 3 Jan 2024 19:46:15 +0000 Subject: [PATCH] Bug 35692: Unit test --- t/db_dependent/Circulation/issue.t | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/t/db_dependent/Circulation/issue.t b/t/db_dependent/Circulation/issue.t index c9cd7f26ffa..26454a210ea 100755 --- a/t/db_dependent/Circulation/issue.t +++ b/t/db_dependent/Circulation/issue.t @@ -462,11 +462,18 @@ AddReturn( 'barcode_3', $branchcode_1 ); $item = Koha::Items->find( $itemnumber ); ok( $item->notforloan eq 0, q{UpdateNotForLoanStatusOnCheckin _ALL_ rules are applied if there are no specific item type rule matching the returned item} ); -t::lib::Mocks::mock_preference( 'UpdateNotForLoanStatusOnCheckin', '1: ONLYMESSAGE' ); +t::lib::Mocks::mock_preference( + 'UpdateNotForLoanStatusOnCheckin', q{_ALL_: + 1: ONLYMESSAGE +} +); $item->notforloan(1)->store; AddReturn( 'barcode_3', $branchcode_1 ); -$item = Koha::Items->find( $itemnumber ); -ok( $item->notforloan eq 1, q{UpdateNotForLoanStatusOnCheckin does not update notforloan value from 1 with setting "1: ONLYMESSAGE"} ); +$item->discard_changes; +ok( + $item->notforloan eq 1, + q{UpdateNotForLoanStatusOnCheckin does not update notforloan value from 1 with setting "1: ONLYMESSAGE"} +); my $itemnumber2 = Koha::Item->new( { -- 2.30.2