Lines 8-14
Link Here
|
8 |
|
8 |
|
9 |
use Modern::Perl; |
9 |
use Modern::Perl; |
10 |
|
10 |
|
11 |
use Test::More tests => 42; |
11 |
use Test::More tests => 43; |
12 |
use Data::Dumper; |
12 |
use Data::Dumper; |
13 |
|
13 |
|
14 |
use C4::Calendar; |
14 |
use C4::Calendar; |
Lines 16-21
use C4::Context;
Link Here
|
16 |
use C4::Members; |
16 |
use C4::Members; |
17 |
use Koha::Database; |
17 |
use Koha::Database; |
18 |
use Koha::DateUtils; |
18 |
use Koha::DateUtils; |
|
|
19 |
use Koha::Items; |
19 |
|
20 |
|
20 |
use t::lib::TestBuilder; |
21 |
use t::lib::TestBuilder; |
21 |
use t::lib::Mocks; |
22 |
use t::lib::Mocks; |
Lines 690-695
CancelReserve( { reserve_id => $reserve_id } );
Link Here
|
690 |
|
691 |
|
691 |
# End testing hold itemtype limit |
692 |
# End testing hold itemtype limit |
692 |
|
693 |
|
|
|
694 |
|
695 |
# Test Local Holds Priority - Bug 18001 |
696 |
t::lib::Mocks::mock_preference('LocalHoldsPriority', 1); |
697 |
t::lib::Mocks::mock_preference('LocalHoldsPriorityPatronControl', 'PickupLibrary'); |
698 |
t::lib::Mocks::mock_preference('LocalHoldsPriorityItemControl', 'homebranch'); |
699 |
|
700 |
$dbh->do("DELETE FROM tmp_holdsqueue"); |
701 |
$dbh->do("DELETE FROM hold_fill_targets"); |
702 |
$dbh->do("DELETE FROM reserves"); |
703 |
$dbh->do("DELETE FROM default_branch_circ_rules"); |
704 |
$dbh->do("DELETE FROM default_branch_item_rules"); |
705 |
$dbh->do("DELETE FROM default_circ_rules"); |
706 |
$dbh->do("DELETE FROM branch_item_rules"); |
707 |
|
708 |
my $item = Koha::Items->find( { biblionumber => $biblionumber } ); |
709 |
$item->holdingbranch( $item->homebranch ); |
710 |
$item->store(); |
711 |
|
712 |
my $item2 = Koha::Item->new( $item->unblessed ); |
713 |
$item2->itemnumber( undef ); |
714 |
$item2->store(); |
715 |
|
716 |
my $item3 = Koha::Item->new( $item->unblessed ); |
717 |
$item3->itemnumber( undef ); |
718 |
$item3->store(); |
719 |
|
720 |
$reserve_id = AddReserve( $item->homebranch, $borrowernumber, $biblionumber, '', 1, undef, undef, undef, undef, undef, undef, undef ); |
721 |
|
722 |
C4::HoldsQueue::CreateQueue(); |
723 |
|
724 |
my $queue_rs = $schema->resultset('TmpHoldsqueue'); |
725 |
is( $queue_rs->count(), 1, "Hold queue contains one hold from chosen from three possible items" ); |
726 |
|
693 |
# Cleanup |
727 |
# Cleanup |
694 |
$schema->storage->txn_rollback; |
728 |
$schema->storage->txn_rollback; |
695 |
|
729 |
|
696 |
- |
|
|