5 use DateTime::TimeZone;
8 use Test::More tests => 8;
10 BEGIN { use_ok('Koha::Calendar'); }
11 BEGIN { use_ok('C4::Calendar'); }
13 my $branchcode = 'MPL';
15 my $koha_calendar = Koha::Calendar->new( branchcode => $branchcode );
16 my $c4_calendar = C4::Calendar->new( branchcode => $branchcode );
18 isa_ok( $koha_calendar, 'Koha::Calendar', 'Koha::Calendar class returned' );
19 isa_ok( $c4_calendar, 'C4::Calendar', 'C4::Calendar class returned' );
21 my $sunday = DateTime->new(
26 my $monday = DateTime->new(
31 my $christmas = DateTime->new(
36 my $newyear = DateTime->new(
42 is( $koha_calendar->is_holiday($sunday), 1, 'Sunday is a closed day' );
43 is( $koha_calendar->is_holiday($monday), 0, 'Monday is not a closed day' );
44 is( $koha_calendar->is_holiday($christmas), 1, 'Christmas is a closed day' );
45 is( $koha_calendar->is_holiday($newyear), 1, 'New Years day is a closed day' );