|
Lines 25-35
use DateTime::Duration;
Link Here
|
| 25 |
use Koha::Caches; |
25 |
use Koha::Caches; |
| 26 |
use Koha::DateUtils; |
26 |
use Koha::DateUtils; |
| 27 |
|
27 |
|
|
|
28 |
use t::lib::Mocks; |
| 29 |
|
| 28 |
use Module::Load::Conditional qw/check_install/; |
30 |
use Module::Load::Conditional qw/check_install/; |
| 29 |
|
31 |
|
| 30 |
BEGIN { |
32 |
BEGIN { |
| 31 |
if ( check_install( module => 'Test::DBIx::Class' ) ) { |
33 |
if ( check_install( module => 'Test::DBIx::Class' ) ) { |
| 32 |
plan tests => 38; |
34 |
plan tests => 39; |
| 33 |
} else { |
35 |
} else { |
| 34 |
plan skip_all => "Need Test::DBIx::Class" |
36 |
plan skip_all => "Need Test::DBIx::Class" |
| 35 |
} |
37 |
} |
|
Lines 321-326
my $holiday_for_another_branch = DateTime->new(
Link Here
|
| 321 |
is ( $cal->is_holiday($holiday_for_another_branch), 1, 'Holiday defined for CPL should be defined as an holiday' ); |
323 |
is ( $cal->is_holiday($holiday_for_another_branch), 1, 'Holiday defined for CPL should be defined as an holiday' ); |
| 322 |
} |
324 |
} |
| 323 |
|
325 |
|
|
|
326 |
subtest 'days_mode parameter' => sub { |
| 327 |
plan tests => 2; |
| 328 |
|
| 329 |
t::lib::Mocks::mock_preference('useDaysMode', 'Days'); |
| 330 |
my $cal = Koha::Calendar->new( branchcode => 'CPL' ); |
| 331 |
is( $cal->{days_mode}, 'Days', q|If not set, days_mode defaults to syspref's value|); |
| 332 |
|
| 333 |
$cal = Koha::Calendar->new( branchcode => 'CPL', days_mode => 'Calendar' ); |
| 334 |
is( $cal->{days_mode}, 'Calendar', q|If set, days_mode is correctly set|); |
| 335 |
}; |
| 336 |
|
| 324 |
END { |
337 |
END { |
| 325 |
$cache->clear_from_cache( 'single_holidays' ) ; |
338 |
$cache->clear_from_cache( 'single_holidays' ) ; |
| 326 |
$cache->clear_from_cache( 'exception_holidays' ) ; |
339 |
$cache->clear_from_cache( 'exception_holidays' ) ; |
| 327 |
- |
|
|