Bugzilla – Attachment 62318 Details for
Bug 18001
LocalHoldsPriority can cause multiple holds queue lines for same hold request
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 18001 - Unit Test
Bug-18001---Unit-Test.patch (text/plain), 2.21 KB, created by
Jonathan Druart
on 2017-04-18 18:40:58 UTC
(
hide
)
Description:
Bug 18001 - Unit Test
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2017-04-18 18:40:58 UTC
Size:
2.21 KB
patch
obsolete
>From a5b73cbc20f632e89434add4ba73ea5ea0c92008 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Tue, 18 Apr 2017 07:38:42 -0400 >Subject: [PATCH] Bug 18001 - Unit Test > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >--- > t/db_dependent/HoldsQueue.t | 36 +++++++++++++++++++++++++++++++++++- > 1 file changed, 35 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/HoldsQueue.t b/t/db_dependent/HoldsQueue.t >index c71a516..3f9d3bd 100755 >--- a/t/db_dependent/HoldsQueue.t >+++ b/t/db_dependent/HoldsQueue.t >@@ -8,7 +8,7 @@ > > use Modern::Perl; > >-use Test::More tests => 42; >+use Test::More tests => 43; > use Data::Dumper; > > use C4::Calendar; >@@ -16,6 +16,7 @@ use C4::Context; > use C4::Members; > use Koha::Database; > use Koha::DateUtils; >+use Koha::Items; > > use t::lib::TestBuilder; > use t::lib::Mocks; >@@ -690,6 +691,39 @@ CancelReserve( { reserve_id => $reserve_id } ); > > # End testing hold itemtype limit > >+ >+# Test Local Holds Priority - Bug 18001 >+t::lib::Mocks::mock_preference('LocalHoldsPriority', 1); >+t::lib::Mocks::mock_preference('LocalHoldsPriorityPatronControl', 'PickupLibrary'); >+t::lib::Mocks::mock_preference('LocalHoldsPriorityItemControl', 'homebranch'); >+ >+$dbh->do("DELETE FROM tmp_holdsqueue"); >+$dbh->do("DELETE FROM hold_fill_targets"); >+$dbh->do("DELETE FROM reserves"); >+$dbh->do("DELETE FROM default_branch_circ_rules"); >+$dbh->do("DELETE FROM default_branch_item_rules"); >+$dbh->do("DELETE FROM default_circ_rules"); >+$dbh->do("DELETE FROM branch_item_rules"); >+ >+my $item = Koha::Items->find( { biblionumber => $biblionumber } ); >+$item->holdingbranch( $item->homebranch ); >+$item->store(); >+ >+my $item2 = Koha::Item->new( $item->unblessed ); >+$item2->itemnumber( undef ); >+$item2->store(); >+ >+my $item3 = Koha::Item->new( $item->unblessed ); >+$item3->itemnumber( undef ); >+$item3->store(); >+ >+$reserve_id = AddReserve( $item->homebranch, $borrowernumber, $biblionumber, '', 1, undef, undef, undef, undef, undef, undef, undef ); >+ >+C4::HoldsQueue::CreateQueue(); >+ >+my $queue_rs = $schema->resultset('TmpHoldsqueue'); >+is( $queue_rs->count(), 1, "Hold queue contains one hold from chosen from three possible items" ); >+ > # Cleanup > $schema->storage->txn_rollback; > >-- >2.9.3
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 18001
:
59588
|
59990
|
62268
|
62269
| 62318 |
62320