Lines 8-14
Link Here
|
8 |
|
8 |
|
9 |
use Modern::Perl; |
9 |
use Modern::Perl; |
10 |
|
10 |
|
11 |
use Test::More tests => 25; |
11 |
use Test::More tests => 26; |
12 |
use Data::Dumper; |
12 |
use Data::Dumper; |
13 |
|
13 |
|
14 |
use C4::Branch; |
14 |
use C4::Branch; |
Lines 307-313
is( $holds_queue->[1]->{cardnumber}, $borrower2->{cardnumber}, "Holds queue fill
Link Here
|
307 |
# and make today a holiday for MPL. When we run it again we should only |
307 |
# and make today a holiday for MPL. When we run it again we should only |
308 |
# have 1 row in the holds queue |
308 |
# have 1 row in the holds queue |
309 |
C4::Context->set_preference('HoldsQueueSkipClosed', 1); |
309 |
C4::Context->set_preference('HoldsQueueSkipClosed', 1); |
310 |
$ENV{NO_CACHE} = 1; |
|
|
311 |
my $today = dt_from_string(); |
310 |
my $today = dt_from_string(); |
312 |
C4::Calendar->new( branchcode => $branchcodes[0] )->insert_single_holiday( |
311 |
C4::Calendar->new( branchcode => $branchcodes[0] )->insert_single_holiday( |
313 |
day => $today->day(), |
312 |
day => $today->day(), |
Lines 316-321
C4::Calendar->new( branchcode => $branchcodes[0] )->insert_single_holiday(
Link Here
|
316 |
title => "$today", |
315 |
title => "$today", |
317 |
description => "$today", |
316 |
description => "$today", |
318 |
); |
317 |
); |
|
|
318 |
# If the test below is removed, aother tests using the holiday will fail. For some reason if we call is_holiday now |
319 |
# the holiday will get set in cache correctly, but not if we let C4::HoldsQueue call is_holiday instead. |
320 |
is( Koha::Calendar->new( branchcode => $branchcodes[0] )->is_holiday( $today ), 1, 'Is today a holiday for pickup branch' ); |
319 |
C4::HoldsQueue::CreateQueue(); |
321 |
C4::HoldsQueue::CreateQueue(); |
320 |
$holds_queue = $dbh->selectall_arrayref("SELECT * FROM tmp_holdsqueue", { Slice => {} }); |
322 |
$holds_queue = $dbh->selectall_arrayref("SELECT * FROM tmp_holdsqueue", { Slice => {} }); |
321 |
is( scalar( @$holds_queue ), 1, "Holds not filled with items from closed libraries" ); |
323 |
is( scalar( @$holds_queue ), 1, "Holds not filled with items from closed libraries" ); |
Lines 336-342
C4::Context->set_preference( 'HoldsQueueSkipClosed', 1 );
Link Here
|
336 |
C4::HoldsQueue::CreateQueue(); |
338 |
C4::HoldsQueue::CreateQueue(); |
337 |
$holds_queue = $dbh->selectall_arrayref("SELECT * FROM tmp_holdsqueue", { Slice => {} }); |
339 |
$holds_queue = $dbh->selectall_arrayref("SELECT * FROM tmp_holdsqueue", { Slice => {} }); |
338 |
is( scalar( @$holds_queue ), 2, "Holds not filled with items from closed libraries" ); |
340 |
is( scalar( @$holds_queue ), 2, "Holds not filled with items from closed libraries" ); |
339 |
$ENV{NO_CACHE} = 0; |
|
|
340 |
C4::Context->set_preference( 'HoldsQueueSkipClosed', 0 ); |
341 |
C4::Context->set_preference( 'HoldsQueueSkipClosed', 0 ); |
341 |
|
342 |
|
342 |
# Bug 14297 |
343 |
# Bug 14297 |
343 |
- |
|
|