From b7051ab27b66d12549b2d7b0a3f994ab6a63f41b Mon Sep 17 00:00:00 2001 From: Lucas Gass Date: Thu, 26 Feb 2026 18:43:32 +0000 Subject: [PATCH] Bug 41880: Add a unit test --- t/db_dependent/Koha/Hold.t | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/t/db_dependent/Koha/Hold.t b/t/db_dependent/Koha/Hold.t index 9ba3a0caa2e..8249ec72278 100755 --- a/t/db_dependent/Koha/Hold.t +++ b/t/db_dependent/Koha/Hold.t @@ -39,6 +39,7 @@ use Koha::Libraries; use Koha::Old::Holds; use C4::Reserves qw( AddReserve ModReserveAffect ); use C4::Circulation qw( AddReturn ); +use JSON qw( decode_json ); my $schema = Koha::Database->new->schema; my $builder = t::lib::TestBuilder->new; @@ -1745,7 +1746,7 @@ subtest 'revert_found() tests' => sub { }; }; subtest 'move_hold() tests' => sub { - plan tests => 13; + plan tests => 16; $schema->storage->txn_begin; my $patron = Koha::Patron->new( @@ -1887,6 +1888,20 @@ subtest 'move_hold() tests' => sub { is( $logs_2->count, 1, 'Hold modification was logged' ); + my $diff_2 = decode_json( $logs_2->next->diff ); + is( + $diff_2->{D}->{biblionumber}->{O}, $biblio3->biblionumber, + 'diff column for Old (O) contains original biblionumber for record level move' + ); + is( + $diff_2->{D}->{biblionumber}->{N}, $biblio4->biblionumber, + 'diff column for New (N) contains new biblionumber for record level move' + ); + is( + $diff_2->{D}->{itemnumber}, undef, + 'diff column contains undef itemnumber because this is a record level move' + ); + #disable HoldsLog t::lib::Mocks::mock_preference( 'HoldsLog', 0 ); -- 2.39.5