Bugzilla – Attachment 161009 Details for
Bug 35357
Item not removed from holds queue when checked out to a different patron
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 35357: Add unit test
Bug-35357-Add-unit-test.patch (text/plain), 2.47 KB, created by
Owen Leonard
on 2024-01-13 14:24:36 UTC
(
hide
)
Description:
Bug 35357: Add unit test
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2024-01-13 14:24:36 UTC
Size:
2.47 KB
patch
obsolete
>From 1be4d7d283d2cc27712d138f0bef900c8707a93b Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Thu, 11 Jan 2024 09:25:26 -0500 >Subject: [PATCH] Bug 35357: Add unit test > >Signed-off-by: Owen Leonard <oleonard@myacpl.org> >--- > t/db_dependent/HoldsQueue.t | 50 ++++++++++++++++++++++++++++++++++++- > 1 file changed, 49 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/HoldsQueue.t b/t/db_dependent/HoldsQueue.t >index 7875c69eed..6bb0d8f0c1 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 ); >@@ -2090,4 +2090,52 @@ subtest "GetItemsAvailableToFillHoldsRequestsForBib" => sub { > is( scalar @$items, 2, "Two items without active transfers correctly retrieved"); > is_deeply( [$items->[0]->{itemnumber},$items->[1]->{itemnumber}],[$item_2->itemnumber,$item_3->itemnumber],"Correct two items retrieved"); > >+ $schema->storage->txn_rollback; >+}; >+ >+subtest 'Remove item from holds queue on checkout' => sub { >+ >+ plan tests => 2; >+ >+ $schema->storage->txn_begin; >+ >+ my $lib = $builder->build_object( { class => 'Koha::Libraries' } ); >+ >+ my $patron1 = $builder->build_object( >+ { >+ class => 'Koha::Patrons', >+ value => { branchcode => $lib->branchcode } >+ } >+ ); >+ my $patron2 = $builder->build_object( >+ { >+ class => 'Koha::Patrons', >+ value => { branchcode => $lib->branchcode } >+ } >+ ); >+ >+ my $item = $builder->build_sample_item( >+ { homebranch => $lib->branchcode, holdingbranch => $lib->branchcode } ); >+ >+ t::lib::Mocks::mock_userenv( { branchcode => $lib->branchcode } ); >+ >+ my $hold_id = AddReserve( >+ { >+ branchcode => $item->homebranch, >+ borrowernumber => $patron2->borrowernumber, >+ biblionumber => $item->biblionumber, >+ itemnumber => undef, >+ priority => 1 >+ } >+ ); >+ >+ C4::HoldsQueue::CreateQueue(); >+ >+ is( Koha::Hold::HoldsQueueItems->search({ itemnumber => $item->id })->count(), 1, "Item is found in the holds queue" ); >+ >+ AddIssue( $patron1, $item->barcode, dt_from_string ); >+ >+ is( Koha::Hold::HoldsQueueItems->search({ itemnumber => $item->id })->count(), 0, "Item is no longer found in the holds queue" ); >+ >+ $schema->storage->txn_rollback; > }; >-- >2.30.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 35357
:
160851
|
160852
|
161009
|
161010
|
161789
|
161790
|
161791
|
161792
|
161849
|
161850
|
161851