Bugzilla – Attachment 162257 Details for
Bug 35997
Cancelling a hold should remove the hold from the queue
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 35997: Add tests
Bug-35997-Add-tests.patch (text/plain), 2.65 KB, created by
Victor Grousset/tuxayo
on 2024-02-19 04:02:33 UTC
(
hide
)
Description:
Bug 35997: Add tests
Filename:
MIME Type:
Creator:
Victor Grousset/tuxayo
Created:
2024-02-19 04:02:33 UTC
Size:
2.65 KB
patch
obsolete
>From 8edec5c84ef746b697bcc3e81f9e3d9dcae61644 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Mon, 5 Feb 2024 14:44:46 -0500 >Subject: [PATCH] Bug 35997: Add tests > >Test plan: see next patch > >Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> >Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net> >--- > 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 7875c69eed..dbd1d23872 100755 >--- a/t/db_dependent/HoldsQueue.t >+++ b/t/db_dependent/HoldsQueue.t >@@ -8,7 +8,7 @@ > > use Modern::Perl; > >-use Test::More tests => 61; >+use Test::More tests => 62; > use Data::Dumper; > > use C4::Calendar qw( new insert_single_holiday ); >@@ -2091,3 +2091,56 @@ subtest "GetItemsAvailableToFillHoldsRequestsForBib" => sub { > is_deeply( [$items->[0]->{itemnumber},$items->[1]->{itemnumber}],[$item_2->itemnumber,$item_3->itemnumber],"Correct two items retrieved"); > > }; >+ >+subtest "Canceled holds should be removed from the holds queue" => sub { >+ >+ plan tests => 2; >+ >+ $schema->storage->txn_begin; >+ >+ t::lib::Mocks::mock_preference( 'LocalHoldsPriority', 0 ); >+ 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)->cancel(); >+ >+ is( >+ $rs->search( { biblionumber => $biblio->biblionumber } )->count, 0, >+ "Hold is no longer found in the holds queue after cancellation" >+ ); >+ >+ $schema->storage->txn_rollback; >+}; >-- >2.43.2
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 35997
:
161766
|
161767
|
161794
|
162257
|
162258
|
163175
|
163176
|
163177