Lines 84-90
my $itemtype = $builder->build( { source => 'Itemtype', value => {
Link Here
|
84 |
#Set up the stage |
84 |
#Set up the stage |
85 |
# Sysprefs and cost matrix |
85 |
# Sysprefs and cost matrix |
86 |
t::lib::Mocks::mock_preference( 'HoldsQueueSkipClosed', 0 ); |
86 |
t::lib::Mocks::mock_preference( 'HoldsQueueSkipClosed', 0 ); |
87 |
t::lib::Mocks::mock_preference( 'LocalHoldsPriority', 0 ); |
87 |
t::lib::Mocks::mock_preference( 'LocalHoldsPriority', 'None' ); |
88 |
$dbh->do( |
88 |
$dbh->do( |
89 |
"UPDATE systempreferences SET value = ? WHERE variable = 'StaticHoldsQueueWeight'", undef, |
89 |
"UPDATE systempreferences SET value = ? WHERE variable = 'StaticHoldsQueueWeight'", undef, |
90 |
join( ',', @other_branches, $borrower_branchcode, $least_cost_branch_code ) |
90 |
join( ',', @other_branches, $borrower_branchcode, $least_cost_branch_code ) |
Lines 436-442
is( scalar(@$holds_queue), 2, "Holds not filled with items from closed libraries
Link Here
|
436 |
t::lib::Mocks::mock_preference( 'HoldsQueueSkipClosed', 0 ); |
436 |
t::lib::Mocks::mock_preference( 'HoldsQueueSkipClosed', 0 ); |
437 |
|
437 |
|
438 |
## Test LocalHoldsPriority |
438 |
## Test LocalHoldsPriority |
439 |
t::lib::Mocks::mock_preference( 'LocalHoldsPriority', 1 ); |
439 |
t::lib::Mocks::mock_preference( 'LocalHoldsPriority', 'GiveLibrary' ); |
440 |
|
440 |
|
441 |
$dbh->do("DELETE FROM circulation_rules"); |
441 |
$dbh->do("DELETE FROM circulation_rules"); |
442 |
Koha::CirculationRules->set_rule( |
442 |
Koha::CirculationRules->set_rule( |
Lines 583-589
is(
Link Here
|
583 |
"Holds queue giving priority to patron who's home library matches item's holding library" |
583 |
"Holds queue giving priority to patron who's home library matches item's holding library" |
584 |
); |
584 |
); |
585 |
|
585 |
|
586 |
t::lib::Mocks::mock_preference( 'LocalHoldsPriority', 0 ); |
586 |
t::lib::Mocks::mock_preference( 'LocalHoldsPriority', 'None' ); |
587 |
## End testing of LocalHoldsPriority |
587 |
## End testing of LocalHoldsPriority |
588 |
|
588 |
|
589 |
# Bug 14297 |
589 |
# Bug 14297 |
Lines 1018-1024
subtest "Test Local Holds Priority - Bib level" => sub {
Link Here
|
1018 |
plan tests => 3; |
1018 |
plan tests => 3; |
1019 |
|
1019 |
|
1020 |
Koha::Biblios->delete(); |
1020 |
Koha::Biblios->delete(); |
1021 |
t::lib::Mocks::mock_preference( 'LocalHoldsPriority', 1 ); |
1021 |
t::lib::Mocks::mock_preference( 'LocalHoldsPriority', 'GiveLibrary' ); |
1022 |
t::lib::Mocks::mock_preference( 'LocalHoldsPriorityPatronControl', 'PickupLibrary' ); |
1022 |
t::lib::Mocks::mock_preference( 'LocalHoldsPriorityPatronControl', 'PickupLibrary' ); |
1023 |
t::lib::Mocks::mock_preference( 'LocalHoldsPriorityItemControl', 'homebranch' ); |
1023 |
t::lib::Mocks::mock_preference( 'LocalHoldsPriorityItemControl', 'homebranch' ); |
1024 |
my $branch = $builder->build_object( { class => 'Koha::Libraries' } ); |
1024 |
my $branch = $builder->build_object( { class => 'Koha::Libraries' } ); |
Lines 1089-1095
subtest "Test Local Holds Priority - Item level" => sub {
Link Here
|
1089 |
plan tests => 2; |
1089 |
plan tests => 2; |
1090 |
|
1090 |
|
1091 |
Koha::Biblios->delete(); |
1091 |
Koha::Biblios->delete(); |
1092 |
t::lib::Mocks::mock_preference( 'LocalHoldsPriority', 1 ); |
1092 |
t::lib::Mocks::mock_preference( 'LocalHoldsPriority', 'GiveLibrary' ); |
1093 |
t::lib::Mocks::mock_preference( 'LocalHoldsPriorityPatronControl', 'PickupLibrary' ); |
1093 |
t::lib::Mocks::mock_preference( 'LocalHoldsPriorityPatronControl', 'PickupLibrary' ); |
1094 |
t::lib::Mocks::mock_preference( 'LocalHoldsPriorityItemControl', 'homebranch' ); |
1094 |
t::lib::Mocks::mock_preference( 'LocalHoldsPriorityItemControl', 'homebranch' ); |
1095 |
my $branch = $builder->build_object( { class => 'Koha::Libraries' } ); |
1095 |
my $branch = $builder->build_object( { class => 'Koha::Libraries' } ); |
Lines 1161-1167
subtest "Test Local Holds Priority - Item level hold over Record level hold (Bug
Link Here
|
1161 |
plan tests => 2; |
1161 |
plan tests => 2; |
1162 |
|
1162 |
|
1163 |
Koha::Biblios->delete(); |
1163 |
Koha::Biblios->delete(); |
1164 |
t::lib::Mocks::mock_preference( 'LocalHoldsPriority', 1 ); |
1164 |
t::lib::Mocks::mock_preference( 'LocalHoldsPriority', 'GiveLibrary' ); |
1165 |
t::lib::Mocks::mock_preference( 'LocalHoldsPriorityPatronControl', 'PickupLibrary' ); |
1165 |
t::lib::Mocks::mock_preference( 'LocalHoldsPriorityPatronControl', 'PickupLibrary' ); |
1166 |
t::lib::Mocks::mock_preference( 'LocalHoldsPriorityItemControl', 'homebranch' ); |
1166 |
t::lib::Mocks::mock_preference( 'LocalHoldsPriorityItemControl', 'homebranch' ); |
1167 |
my $branch = $builder->build_object( { class => 'Koha::Libraries' } ); |
1167 |
my $branch = $builder->build_object( { class => 'Koha::Libraries' } ); |
Lines 1232-1238
subtest "Test Local Holds Priority - Get correct item for item level hold" => su
Link Here
|
1232 |
plan tests => 3; |
1232 |
plan tests => 3; |
1233 |
|
1233 |
|
1234 |
Koha::Biblios->delete(); |
1234 |
Koha::Biblios->delete(); |
1235 |
t::lib::Mocks::mock_preference( 'LocalHoldsPriority', 1 ); |
1235 |
t::lib::Mocks::mock_preference( 'LocalHoldsPriority', 'GiveLibrary' ); |
1236 |
t::lib::Mocks::mock_preference( 'LocalHoldsPriorityPatronControl', 'PickupLibrary' ); |
1236 |
t::lib::Mocks::mock_preference( 'LocalHoldsPriorityPatronControl', 'PickupLibrary' ); |
1237 |
t::lib::Mocks::mock_preference( 'LocalHoldsPriorityItemControl', 'homebranch' ); |
1237 |
t::lib::Mocks::mock_preference( 'LocalHoldsPriorityItemControl', 'homebranch' ); |
1238 |
my $branch = $builder->build_object( { class => 'Koha::Libraries' } ); |
1238 |
my $branch = $builder->build_object( { class => 'Koha::Libraries' } ); |
Lines 1316-1322
subtest "Test Local Holds Priority - Ensure no duplicate requests in holds queue
Link Here
|
1316 |
$dbh->do("DELETE FROM circulation_rules"); |
1316 |
$dbh->do("DELETE FROM circulation_rules"); |
1317 |
Koha::Biblios->delete(); |
1317 |
Koha::Biblios->delete(); |
1318 |
|
1318 |
|
1319 |
t::lib::Mocks::mock_preference( 'LocalHoldsPriority', 1 ); |
1319 |
t::lib::Mocks::mock_preference( 'LocalHoldsPriority', 'GiveLibrary' ); |
1320 |
t::lib::Mocks::mock_preference( 'LocalHoldsPriorityPatronControl', 'PickupLibrary' ); |
1320 |
t::lib::Mocks::mock_preference( 'LocalHoldsPriorityPatronControl', 'PickupLibrary' ); |
1321 |
t::lib::Mocks::mock_preference( 'LocalHoldsPriorityItemControl', 'homebranch' ); |
1321 |
t::lib::Mocks::mock_preference( 'LocalHoldsPriorityItemControl', 'homebranch' ); |
1322 |
my $branch = $builder->build_object( { class => 'Koha::Libraries' } ); |
1322 |
my $branch = $builder->build_object( { class => 'Koha::Libraries' } ); |
Lines 1481-1487
subtest 'Excludes from local holds priority' => sub {
Link Here
|
1481 |
|
1481 |
|
1482 |
Koha::Holds->delete; |
1482 |
Koha::Holds->delete; |
1483 |
|
1483 |
|
1484 |
t::lib::Mocks::mock_preference( 'LocalHoldsPriority', 1 ); |
1484 |
t::lib::Mocks::mock_preference( 'LocalHoldsPriority', 'GiveLibrary' ); |
1485 |
t::lib::Mocks::mock_preference( 'LocalHoldsPriorityPatronControl', 'PickupLibrary' ); |
1485 |
t::lib::Mocks::mock_preference( 'LocalHoldsPriorityPatronControl', 'PickupLibrary' ); |
1486 |
t::lib::Mocks::mock_preference( 'LocalHoldsPriorityItemControl', 'homebranch' ); |
1486 |
t::lib::Mocks::mock_preference( 'LocalHoldsPriorityItemControl', 'homebranch' ); |
1487 |
|
1487 |
|
Lines 1612-1618
subtest "Test item group holds" => sub {
Link Here
|
1612 |
$dbh->do("DELETE FROM circulation_rules"); |
1612 |
$dbh->do("DELETE FROM circulation_rules"); |
1613 |
|
1613 |
|
1614 |
t::lib::Mocks::mock_preference( 'HoldsQueueSkipClosed', 0 ); |
1614 |
t::lib::Mocks::mock_preference( 'HoldsQueueSkipClosed', 0 ); |
1615 |
t::lib::Mocks::mock_preference( 'LocalHoldsPriority', 0 ); |
1615 |
t::lib::Mocks::mock_preference( 'LocalHoldsPriority', 'None' ); |
1616 |
|
1616 |
|
1617 |
my $library = $builder->build_object( { class => 'Koha::Libraries' } ); |
1617 |
my $library = $builder->build_object( { class => 'Koha::Libraries' } ); |
1618 |
my $category = $builder->build_object( |
1618 |
my $category = $builder->build_object( |
Lines 2200-2206
subtest "Test HoldsQueuePrioritizeBranch" => sub {
Link Here
|
2200 |
|
2200 |
|
2201 |
$schema->storage->txn_begin; |
2201 |
$schema->storage->txn_begin; |
2202 |
|
2202 |
|
2203 |
t::lib::Mocks::mock_preference( 'LocalHoldsPriority', 0 ); |
2203 |
t::lib::Mocks::mock_preference( 'LocalHoldsPriority', 'None' ); |
2204 |
t::lib::Mocks::mock_preference( 'UseTransportCostMatrix', 0 ); |
2204 |
t::lib::Mocks::mock_preference( 'UseTransportCostMatrix', 0 ); |
2205 |
|
2205 |
|
2206 |
my $branch1 = $builder->build_object( { class => 'Koha::Libraries' } ); |
2206 |
my $branch1 = $builder->build_object( { class => 'Koha::Libraries' } ); |
Lines 2409-2415
subtest "Canceled holds should be removed from the holds queue" => sub {
Link Here
|
2409 |
|
2409 |
|
2410 |
$schema->storage->txn_begin; |
2410 |
$schema->storage->txn_begin; |
2411 |
|
2411 |
|
2412 |
t::lib::Mocks::mock_preference( 'LocalHoldsPriority', 0 ); |
2412 |
t::lib::Mocks::mock_preference( 'LocalHoldsPriority', 'None' ); |
2413 |
t::lib::Mocks::mock_preference( 'UseTransportCostMatrix', 0 ); |
2413 |
t::lib::Mocks::mock_preference( 'UseTransportCostMatrix', 0 ); |
2414 |
|
2414 |
|
2415 |
my $branch1 = $builder->build_object( { class => 'Koha::Libraries' } ); |
2415 |
my $branch1 = $builder->build_object( { class => 'Koha::Libraries' } ); |
2416 |
- |
|
|