Lines 307-321
C4::Calendar->new( branchcode => 'MPL' )->insert_single_holiday(
Link Here
|
307 |
); |
307 |
); |
308 |
C4::HoldsQueue::CreateQueue(); |
308 |
C4::HoldsQueue::CreateQueue(); |
309 |
$holds_queue = $dbh->selectall_arrayref("SELECT * FROM tmp_holdsqueue", { Slice => {} }); |
309 |
$holds_queue = $dbh->selectall_arrayref("SELECT * FROM tmp_holdsqueue", { Slice => {} }); |
310 |
ok( @$holds_queue == 1, "Holds not filled with items from closed libraries" ); |
310 |
is( scalar( @$holds_queue ), 1, "Holds not filled with items from closed libraries" ); |
311 |
C4::Context->set_preference('HoldsQueueSkipClosed', 0); |
311 |
C4::Context->set_preference('HoldsQueueSkipClosed', 0); |
312 |
|
312 |
|
313 |
$dbh->do("DELETE FROM default_circ_rules"); |
313 |
$dbh->do("DELETE FROM default_circ_rules"); |
314 |
$dbh->do("INSERT INTO default_circ_rules ( holdallowed ) VALUES ( 2 )"); |
314 |
$dbh->do("INSERT INTO default_circ_rules ( holdallowed ) VALUES ( 2 )"); |
315 |
C4::HoldsQueue::CreateQueue(); |
315 |
C4::HoldsQueue::CreateQueue(); |
316 |
$holds_queue = $dbh->selectall_arrayref("SELECT * FROM tmp_holdsqueue", { Slice => {} }); |
316 |
$holds_queue = $dbh->selectall_arrayref("SELECT * FROM tmp_holdsqueue", { Slice => {} }); |
317 |
ok( @$holds_queue == 3, "Holds queue filling correct number for holds for default holds policy 'from any library'" ); |
317 |
is( scalar( @$holds_queue ), 3, "Holds queue filling correct number for holds for default holds policy 'from any library'" ); |
318 |
#warn "HOLDS QUEUE: " . Data::Dumper::Dumper( $holds_queue ); |
|
|
319 |
|
318 |
|
320 |
# Test skipping hold picks for closed libraries without transport cost matrix |
319 |
# Test skipping hold picks for closed libraries without transport cost matrix |
321 |
# At this point in the test, we have 3 rows in the holds queue |
320 |
# At this point in the test, we have 3 rows in the holds queue |
Lines 325-331
ok( @$holds_queue == 3, "Holds queue filling correct number for holds for defaul
Link Here
|
325 |
C4::Context->set_preference( 'HoldsQueueSkipClosed', 1 ); |
324 |
C4::Context->set_preference( 'HoldsQueueSkipClosed', 1 ); |
326 |
C4::HoldsQueue::CreateQueue(); |
325 |
C4::HoldsQueue::CreateQueue(); |
327 |
$holds_queue = $dbh->selectall_arrayref("SELECT * FROM tmp_holdsqueue", { Slice => {} }); |
326 |
$holds_queue = $dbh->selectall_arrayref("SELECT * FROM tmp_holdsqueue", { Slice => {} }); |
328 |
ok( @$holds_queue == 2, "Holds not filled with items from closed libraries" ); |
327 |
is( scalar( @$holds_queue ), 2, "Holds not filled with items from closed libraries" ); |
329 |
|
328 |
|
330 |
# Cleanup |
329 |
# Cleanup |
331 |
$dbh->rollback; |
330 |
$dbh->rollback; |
332 |
- |
|
|