Lines 234-251
subtest 'copy_to_branch' => sub {
Link Here
|
234 |
my $calendar2 = C4::Calendar->new( branchcode => $branch2 ); |
234 |
my $calendar2 = C4::Calendar->new( branchcode => $branch2 ); |
235 |
my $exceptions = $calendar2->get_exception_holidays; |
235 |
my $exceptions = $calendar2->get_exception_holidays; |
236 |
|
236 |
|
237 |
is( $calendar2->isHoliday( $sunday->day, $sunday->month, $sunday->year ), 1, "Weekday holiday copied to branch 2" ); |
|
|
238 |
is( |
237 |
is( |
239 |
$calendar2->isHoliday( $day_month->day, $day_month->month, $day_month->year ), 1, |
238 |
$calendar2->isHoliday( $sunday->day, $sunday->month, $sunday->year, 0 ), 1, |
|
|
239 |
"Weekday holiday copied to branch 2" |
240 |
); |
241 |
is( |
242 |
$calendar2->isHoliday( $day_month->day, $day_month->month, $day_month->year, 0 ), 1, |
240 |
"Day/month holiday copied to branch 2" |
243 |
"Day/month holiday copied to branch 2" |
241 |
); |
244 |
); |
242 |
is( |
245 |
is( |
243 |
$calendar2->isHoliday( $future_date->day, $future_date->month, $future_date->year ), 1, |
246 |
$calendar2->isHoliday( $future_date->day, $future_date->month, $future_date->year, 0 ), 1, |
244 |
"Single holiday copied to branch 2" |
247 |
"Single holiday copied to branch 2" |
245 |
); |
248 |
); |
246 |
is( ( grep { $_->{date} eq "9999-12-30" } values %$exceptions ), 1, "Exception holiday copied to branch 2" ); |
249 |
is( ( grep { $_->{date} eq "9999-12-30" } values %$exceptions ), 1, "Exception holiday copied to branch 2" ); |
247 |
is( |
250 |
is( |
248 |
$calendar2->isHoliday( $past_date->day, $past_date->month, $past_date->year ), 0, |
251 |
$calendar2->isHoliday( $past_date->day, $past_date->month, $past_date->year, 0 ), 0, |
249 |
"Don't copy past single holidays" |
252 |
"Don't copy past single holidays" |
250 |
); |
253 |
); |
251 |
is( ( grep { $_->{date} eq "2020-03-09" } values %$exceptions ), 0, "Don't copy past exception holidays " ); |
254 |
is( ( grep { $_->{date} eq "2020-03-09" } values %$exceptions ), 0, "Don't copy past exception holidays " ); |