Bugzilla – Attachment 105983 Details for
Bug 25783
Holds Queue treating item-level holds as bib-level
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 25783: Regression tests
Bug-25783-Regression-tests.patch (text/plain), 3.08 KB, created by
Tomás Cohen Arazi (tcohen)
on 2020-06-17 20:23:15 UTC
(
hide
)
Description:
Bug 25783: Regression tests
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2020-06-17 20:23:15 UTC
Size:
3.08 KB
patch
obsolete
>From fe5ab4f7a4a11e8f5b552a1f8802dc04562b5884 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Wed, 17 Jun 2020 17:18:12 -0300 >Subject: [PATCH] Bug 25783: Regression tests > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > t/db_dependent/HoldsQueue.t | 78 ++++++++++++++++++++++++++++++++++++- > 1 file changed, 77 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/HoldsQueue.t b/t/db_dependent/HoldsQueue.t >index ef5d89324dd..323742cc46c 100755 >--- a/t/db_dependent/HoldsQueue.t >+++ b/t/db_dependent/HoldsQueue.t >@@ -8,7 +8,7 @@ > > use Modern::Perl; > >-use Test::More tests => 51; >+use Test::More tests => 52; > use Data::Dumper; > > use C4::Calendar; >@@ -1159,6 +1159,82 @@ subtest "Test Local Holds Priority - Ensure no duplicate requests in holds queue > }; > > >+subtest "Item level holds info is preserved (Bug 25738)" => sub { >+ >+ plan tests => 3; >+ >+ $dbh->do("DELETE FROM tmp_holdsqueue"); >+ $dbh->do("DELETE FROM hold_fill_targets"); >+ $dbh->do("DELETE FROM reserves"); >+ $dbh->do("DELETE FROM circulation_rules"); >+ >+ my $library = $builder->build_object({ class => 'Koha::Libraries' }); >+ my $patron_1 = $builder->build_object( >+ { >+ class => "Koha::Patrons", >+ value => { >+ branchcode => $library->branchcode >+ } >+ } >+ ); >+ >+ my $patron_2 = $builder->build_object( >+ { >+ class => "Koha::Patrons", >+ value => { >+ branchcode => $library->branchcode >+ } >+ } >+ ); >+ >+ my $biblio = $builder->build_sample_biblio(); >+ my $item_1 = $builder->build_sample_item( >+ { >+ biblionumber => $biblio->biblionumber, >+ library => $library->branchcode, >+ } >+ ); >+ my $item_2 = $builder->build_sample_item( >+ { >+ biblionumber => $biblio->biblionumber, >+ library => $library->branchcode, >+ } >+ ); >+ >+ # Add item-level hold for patron_1 >+ my $reserve_id_1 = AddReserve( >+ { >+ branchcode => $library->branchcode, >+ borrowernumber => $patron_1->borrowernumber, >+ biblionumber => $biblio->id, >+ itemnumber => $item_1->itemnumber, >+ priority => 1 >+ } >+ ); >+ >+ my $reserve_id_2 = AddReserve( >+ { >+ branchcode => $library->branchcode, >+ borrowernumber => $patron_2->borrowernumber, >+ biblionumber => $biblio->id, >+ priority => 2 >+ } >+ ); >+ >+ C4::HoldsQueue::CreateQueue(); >+ >+ my $queue_rs = $schema->resultset('TmpHoldsqueue'); >+ >+ is( $queue_rs->count(), 2, "Hold queue contains two holds" ); >+ >+ my $queue_line_1 = $queue_rs->next; >+ is( $queue_line_1->item_level_request, 1, 'Request is correctly advertised as item-level' ); >+ >+ my $queue_line_2 = $queue_rs->next; >+ is( $queue_line_2->item_level_request, 0, 'Request is correctly advertised as biblio-level' ); >+ >+}; >+ > subtest 'Trivial test for UpdateTransportCostMatrix' => sub { > plan tests => 1; > my $recs = [ >-- >2.27.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 25783
:
105973
|
105974
|
105982
|
105983
|
105984
|
105992
|
105993
|
106166