From 771f7000d4ccd0b3090e3768392c9cacea566731 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Tue, 23 Jul 2013 08:42:27 -0400 Subject: [PATCH] Bug 10628 - AutomaticItemReturn prevents holds queue from filling local holds with local items - Add unit test from least_cost_branch --- t/db_dependent/HoldsQueue.t | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletions(-) diff --git a/t/db_dependent/HoldsQueue.t b/t/db_dependent/HoldsQueue.t index 8de2583..1aac4e7 100755 --- a/t/db_dependent/HoldsQueue.t +++ b/t/db_dependent/HoldsQueue.t @@ -12,7 +12,7 @@ use C4::Context; use Data::Dumper; -use Test::More tests => 18; +use Test::More tests => 19; use C4::Branch; use C4::ItemType; @@ -148,6 +148,11 @@ ok( $queue_item && $queue_item->{holdingbranch} eq $least_cost_branch_code, "GetHoldsQueueItems" ) or diag( "Expected item for pick $borrower_branchcode, hold $least_cost_branch_code, got ".Dumper($queue_item) ); +ok( + C4::HoldsQueue::least_cost_branch( 'B', [ 'A', 'B', 'C' ] ) eq 'B', + 'C4::HoldsQueue::least_cost_branch returns the local branch if it is in the list of branches to pull from' +); + # XXX All this tests are for borrower branch pick-up. # Maybe needs expanding to homebranch or holdingbranch pick-up. -- 1.7.2.5