Bugzilla – Attachment 108499 Details for
Bug 18958
If patron has multiple record level holds on one record transferring first hold causes next hold to become item level
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 18958: Unit tests
Bug-18958-Unit-tests.patch (text/plain), 3.43 KB, created by
Andrew Fuerste-Henry
on 2020-08-18 13:03:24 UTC
(
hide
)
Description:
Bug 18958: Unit tests
Filename:
MIME Type:
Creator:
Andrew Fuerste-Henry
Created:
2020-08-18 13:03:24 UTC
Size:
3.43 KB
patch
obsolete
>From 4c9f2ef771159f049cf499be4c754fed8378e517 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Mon, 12 Aug 2019 18:41:24 +0000 >Subject: [PATCH] Bug 18958: Unit tests > >Signed-off-by: Bonnie Gardner <bgardner@cityoflewiston.org> >Signed-off-by: Bouzid Fergani <bouzid.fergani@inlibro.com> > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> > >Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> >--- > t/db_dependent/Reserves.t | 67 ++++++++++++++++++++++++++++++++++++++++++++++- > 1 file changed, 66 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Reserves.t b/t/db_dependent/Reserves.t >index 376737f5f6..7b8650689a 100755 >--- a/t/db_dependent/Reserves.t >+++ b/t/db_dependent/Reserves.t >@@ -17,7 +17,7 @@ > > use Modern::Perl; > >-use Test::More tests => 63; >+use Test::More tests => 64; > use Test::MockModule; > use Test::Warn; > >@@ -1078,6 +1078,71 @@ subtest 'RevertWaitingStatus' => sub { > ); > }; > >+subtest 'CheckReserves additional test' => sub { >+ >+ plan tests => 3; >+ >+ my $biblio = $builder->build_sample_biblio(); >+ my $itype = $builder->build_object({ class => "Koha::ItemTypes", value => { notforloan => 0 } }); >+ my $item_1 = $builder->build_sample_item({ biblionumber => $biblio->biblionumber,notforloan => 0, itype => $itype->itemtype }); >+ my $reserve1 = $builder->build_object({ >+ class => "Koha::Holds", >+ value => { >+ found => undef, >+ priority => 1, >+ itemnumber => undef, >+ biblionumber => $biblio->biblionumber, >+ waitingdate => undef, >+ cancellationdate => undef, >+ item_level_hold => 0, >+ lowestPriority => 0, >+ expirationdate => undef, >+ suspend_until => undef, >+ suspend => 0, >+ itemtype => undef, >+ } >+ }); >+ my $reserve2 = $builder->build_object({ >+ class => "Koha::Holds", >+ value => { >+ found => undef, >+ priority => 2, >+ biblionumber => $biblio->biblionumber, >+ borrowernumber => $reserve1->borrowernumber, >+ itemnumber => undef, >+ waitingdate => undef, >+ cancellationdate => undef, >+ item_level_hold => 0, >+ lowestPriority => 0, >+ expirationdate => undef, >+ suspend_until => undef, >+ suspend => 0, >+ itemtype => undef, >+ } >+ }); >+ >+ my $tmp_holdsqueue = $builder->build({source=>'TmpHoldsqueue',value=>{ >+ borrowernumber => $reserve1->borrowernumber, >+ biblionumber => $reserve1->biblionumber, >+ } >+ }); >+ my $fill_target = $builder->build({source=>'HoldFillTarget',value=>{ >+ borrowernumber => $reserve1->borrowernumber, >+ biblionumber => $reserve1->biblionumber, >+ itemnumber => $item_1->itemnumber, >+ item_level_request => 0, >+ } >+ }); >+ >+ ModReserveAffect( $item_1->itemnumber, $reserve1->borrowernumber, 1, $reserve1->reserve_id ); >+ my ($status, $matched_reserve, $possible_reserves) = CheckReserves($item_1->itemnumber); >+ >+ is( $status, 'Reserved', "We found a reserve" ); >+ is( $matched_reserve->{reserve_id}, $reserve1->reserve_id, "We got the Transit reserve"); >+ is( scalar @$possible_reserves, 1, 'We only get the one matched'); >+ >+}; >+ > sub count_hold_print_messages { > my $message_count = $dbh->selectall_arrayref(q{ > SELECT COUNT(*) >-- >2.11.0
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 18958
:
65104
|
65150
|
65184
|
71164
|
71232
|
72210
|
72211
|
72348
|
72349
|
92159
|
92160
|
93106
|
93107
|
93108
|
93111
|
93112
|
93113
|
93216
|
93217
|
93218
|
107576
|
107577
|
107582
|
107584
|
107585
|
107586
|
108256
|
108274
|
108473
|
108474
|
108497
|
108499
|
108500
|
108936
|
108937
|
109061
|
109222
|
109640
|
109641
|
109642
|
109643
|
109644
|
109645