View | Details | Raw Unified | Return to bug 8110
Collapse All | Expand All

(-)a/t/db_dependent/Holidays.t (-1 / +45 lines)
Line 0 Link Here
0
- 
1
use strict;
2
use warnings;
3
use 5.010;
4
use DateTime;
5
use DateTime::TimeZone;
6
7
use C4::Context;
8
use Test::More tests => 8;
9
10
BEGIN { use_ok('Koha::Calendar'); }
11
BEGIN { use_ok('C4::Calendar'); }
12
13
my $branchcode = 'MPL';
14
15
my $koha_calendar = Koha::Calendar->new( branchcode => $branchcode );
16
my $c4_calendar = C4::Calendar->new( branchcode => $branchcode );
17
18
isa_ok( $koha_calendar, 'Koha::Calendar', 'Koha::Calendar class returned' );
19
isa_ok( $c4_calendar,   'C4::Calendar',   'C4::Calendar class returned' );
20
21
my $sunday = DateTime->new(
22
    year  => 2011,
23
    month => 6,
24
    day   => 26,
25
);
26
my $monday = DateTime->new(
27
    year  => 2011,
28
    month => 6,
29
    day   => 27,
30
);
31
my $christmas = DateTime->new(
32
    year  => 2032,
33
    month => 12,
34
    day   => 25,
35
);
36
my $newyear = DateTime->new(
37
    year  => 2035,
38
    month => 1,
39
    day   => 1,
40
);
41
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' );

Return to bug 8110