Bugzilla – Attachment 192916 Details for
Bug 41552
Holds are not removed from holds queue when hold is suspended
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 41552: Add unit tests
35dc09a.patch (text/plain), 2.48 KB, created by
Kyle M Hall (khall)
on 2026-02-10 16:54:10 UTC
(
hide
)
Description:
Bug 41552: Add unit tests
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2026-02-10 16:54:10 UTC
Size:
2.48 KB
patch
obsolete
>From 35dc09a6ae1438e1a6d0b50ebf1f4ed0eba3a88e Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Tue, 10 Feb 2026 11:46:12 -0500 >Subject: [PATCH] Bug 41552: Add unit tests > >--- > t/db_dependent/HoldsQueue.t | 55 ++++++++++++++++++++++++++++++++++++- > 1 file changed, 54 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/HoldsQueue.t b/t/db_dependent/HoldsQueue.t >index b4db63abfe3..ace1c3a3986 100755 >--- a/t/db_dependent/HoldsQueue.t >+++ b/t/db_dependent/HoldsQueue.t >@@ -9,7 +9,7 @@ > use Modern::Perl; > > use Test::NoWarnings; >-use Test::More tests => 65; >+use Test::More tests => 66; > use Data::Dumper; > > use C4::Calendar; >@@ -2534,3 +2534,56 @@ subtest "Test unallocated option" => sub { > "Previously allocated hold not updated when unallocated passed and others are allocated" > ); > }; >+ >+subtest "Suspended holds should be removed from the holds queue" => sub { >+ >+ plan tests => 2; >+ >+ $schema->storage->txn_begin; >+ >+ t::lib::Mocks::mock_preference( 'LocalHoldsPriority', 'None' ); >+ t::lib::Mocks::mock_preference( 'UseTransportCostMatrix', 0 ); >+ >+ my $branch1 = $builder->build_object( { class => 'Koha::Libraries' } ); >+ my $category = $builder->build_object( { class => 'Koha::Patron::Categories' } ); >+ my $patron = $builder->build_object( >+ { >+ class => "Koha::Patrons", >+ value => { >+ branchcode => $branch1->branchcode, >+ categorycode => $category->categorycode >+ } >+ } >+ ); >+ >+ my $biblio = $builder->build_sample_biblio(); >+ my $item1 = $builder->build_sample_item( >+ { >+ biblionumber => $biblio->biblionumber, >+ library => $branch1->branchcode, >+ } >+ ); >+ >+ my $reserve_id = AddReserve( >+ { >+ branchcode => $branch1->branchcode, >+ borrowernumber => $patron->borrowernumber, >+ biblionumber => $biblio->biblionumber, >+ priority => 1, >+ } >+ ); >+ >+ C4::HoldsQueue::CreateQueue(); >+ my $rs = $schema->resultset('TmpHoldsqueue'); >+ >+ is( $rs->search( { biblionumber => $biblio->biblionumber } )->count, 1, "Found the hold in the holds queue" ); >+ >+ Koha::Holds->find($reserve_id)->suspend_hold(); >+ >+ is( >+ $rs->search( { biblionumber => $biblio->biblionumber } )->count, 0, >+ "Hold is no longer found in the holds queue after suspension" >+ ); >+ >+ $schema->storage->txn_rollback; >+}; >-- >2.50.1 (Apple Git-155) >
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 41552
:
192914
|
192915
| 192916 |
192917