Lines 5-11
use DateTime;
Link Here
|
5 |
use DateTime::TimeZone; |
5 |
use DateTime::TimeZone; |
6 |
|
6 |
|
7 |
use C4::Context; |
7 |
use C4::Context; |
8 |
use Test::More tests => 10; |
8 |
use Koha::DateUtils; |
|
|
9 |
use Test::More tests => 12; |
9 |
|
10 |
|
10 |
BEGIN { use_ok('Koha::Calendar'); } |
11 |
BEGIN { use_ok('Koha::Calendar'); } |
11 |
BEGIN { use_ok('C4::Calendar'); } |
12 |
BEGIN { use_ok('C4::Calendar'); } |
Lines 53-55
is( $koha_calendar->is_holiday($custom_holiday), 0, '2013-11-10 does not start o
Link Here
|
53 |
$koha_calendar->add_holiday($custom_holiday); |
54 |
$koha_calendar->add_holiday($custom_holiday); |
54 |
is( $koha_calendar->is_holiday($custom_holiday), 1, 'able to add holiday for testing' ); |
55 |
is( $koha_calendar->is_holiday($custom_holiday), 1, 'able to add holiday for testing' ); |
55 |
|
56 |
|
56 |
- |
57 |
my $today = dt_from_string(); |
|
|
58 |
C4::Calendar->new( branchcode => 'CPL' )->insert_single_holiday( |
59 |
day => $today->day(), |
60 |
month => $today->month(), |
61 |
year => $today->year(), |
62 |
title => "$today", |
63 |
description => "$today", |
64 |
); |
65 |
is( Koha::Calendar->new( branchcode => 'CPL' )->is_holiday( $today ), 1, "Today is a holiday for CPL" ); |
66 |
is( Koha::Calendar->new( branchcode => 'MPL' )->is_holiday( $today ), 0, "Today is not a holiday for MPL"); |