Lines 669-674
$reserve_id = AddReserve(
Link Here
|
669 |
C4::HoldsQueue::CreateQueue(); |
669 |
C4::HoldsQueue::CreateQueue(); |
670 |
$holds_queue = $dbh->selectall_arrayref( "SELECT * FROM tmp_holdsqueue", { Slice => {} } ); |
670 |
$holds_queue = $dbh->selectall_arrayref( "SELECT * FROM tmp_holdsqueue", { Slice => {} } ); |
671 |
is( @$holds_queue, 1, "Hold where pickup branch matches home branch targeted" ); |
671 |
is( @$holds_queue, 1, "Hold where pickup branch matches home branch targeted" ); |
|
|
672 |
my $target_rs = $schema->resultset('HoldFillTarget'); |
673 |
is( $target_rs->next->reserve_id, $reserve_id, "Reserve id correctly set in hold fill target for title level hold" ); |
672 |
Koha::Holds->find( $reserve_id )->cancel; |
674 |
Koha::Holds->find( $reserve_id )->cancel; |
673 |
|
675 |
|
674 |
# Holding branch matches pickup branch |
676 |
# Holding branch matches pickup branch |
Lines 915-921
Koha::Holds->find( $reserve_id )->cancel;
Link Here
|
915 |
|
917 |
|
916 |
|
918 |
|
917 |
subtest "Test Local Holds Priority - Bib level" => sub { |
919 |
subtest "Test Local Holds Priority - Bib level" => sub { |
918 |
plan tests => 2; |
920 |
plan tests => 3; |
919 |
|
921 |
|
920 |
Koha::Biblios->delete(); |
922 |
Koha::Biblios->delete(); |
921 |
t::lib::Mocks::mock_preference( 'LocalHoldsPriority', 1 ); |
923 |
t::lib::Mocks::mock_preference( 'LocalHoldsPriority', 1 ); |
Lines 971-976
subtest "Test Local Holds Priority - Bib level" => sub {
Link Here
|
971 |
C4::HoldsQueue::CreateQueue(); |
973 |
C4::HoldsQueue::CreateQueue(); |
972 |
|
974 |
|
973 |
my $queue_rs = $schema->resultset('TmpHoldsqueue'); |
975 |
my $queue_rs = $schema->resultset('TmpHoldsqueue'); |
|
|
976 |
my $target_rs = $schema->resultset('HoldFillTarget'); |
974 |
is( $queue_rs->count(), 1, |
977 |
is( $queue_rs->count(), 1, |
975 |
"Hold queue contains one hold" ); |
978 |
"Hold queue contains one hold" ); |
976 |
is( |
979 |
is( |
Lines 978-983
subtest "Test Local Holds Priority - Bib level" => sub {
Link Here
|
978 |
$local_patron->borrowernumber, |
981 |
$local_patron->borrowernumber, |
979 |
"We should pick the local hold over the next available" |
982 |
"We should pick the local hold over the next available" |
980 |
); |
983 |
); |
|
|
984 |
is( $target_rs->next->reserve_id, $reserve_id2, "Reserve id correctly set in hold fill target" ); |
981 |
}; |
985 |
}; |
982 |
|
986 |
|
983 |
subtest "Test Local Holds Priority - Item level" => sub { |
987 |
subtest "Test Local Holds Priority - Item level" => sub { |
Lines 1263-1269
subtest "Test Local Holds Priority - Ensure no duplicate requests in holds queue
Link Here
|
1263 |
|
1267 |
|
1264 |
subtest "Item level holds info is preserved (Bug 25738)" => sub { |
1268 |
subtest "Item level holds info is preserved (Bug 25738)" => sub { |
1265 |
|
1269 |
|
1266 |
plan tests => 3; |
1270 |
plan tests => 4; |
1267 |
|
1271 |
|
1268 |
$dbh->do("DELETE FROM tmp_holdsqueue"); |
1272 |
$dbh->do("DELETE FROM tmp_holdsqueue"); |
1269 |
$dbh->do("DELETE FROM hold_fill_targets"); |
1273 |
$dbh->do("DELETE FROM hold_fill_targets"); |
Lines 1336-1341
subtest "Item level holds info is preserved (Bug 25738)" => sub {
Link Here
|
1336 |
|
1340 |
|
1337 |
my $queue_line_1 = $queue_rs->next; |
1341 |
my $queue_line_1 = $queue_rs->next; |
1338 |
is( $queue_line_1->item_level_request, 1, 'Request is correctly advertised as item-level' ); |
1342 |
is( $queue_line_1->item_level_request, 1, 'Request is correctly advertised as item-level' ); |
|
|
1343 |
my $target_rs = $schema->resultset('HoldFillTarget')->search({borrowernumber=>$patron_1->borrowernumber});; |
1344 |
is( $target_rs->next->reserve_id, $reserve_id_1, "Reserve id correctly set in hold fill target for item level hold" ); |
1339 |
|
1345 |
|
1340 |
my $queue_line_2 = $queue_rs->next; |
1346 |
my $queue_line_2 = $queue_rs->next; |
1341 |
is( $queue_line_2->item_level_request, 0, 'Request is correctly advertised as biblio-level' ); |
1347 |
is( $queue_line_2->item_level_request, 0, 'Request is correctly advertised as biblio-level' ); |
1342 |
- |
|
|