From a0e9a12b43828cb9b284ccd809e51cb3c26ce895 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Thu, 21 Aug 2014 09:47:37 -0400 Subject: [PATCH] Bug 12801 - Unit Test --- t/db_dependent/Holidays.t | 13 ++++++++++++- 1 files changed, 12 insertions(+), 1 deletions(-) diff --git a/t/db_dependent/Holidays.t b/t/db_dependent/Holidays.t index 9d41105..5941691 100755 --- a/t/db_dependent/Holidays.t +++ b/t/db_dependent/Holidays.t @@ -5,7 +5,8 @@ use DateTime; use DateTime::TimeZone; use C4::Context; -use Test::More tests => 10; +use Koha::DateUtils; +use Test::More tests => 12; BEGIN { use_ok('Koha::Calendar'); } BEGIN { use_ok('C4::Calendar'); } @@ -53,3 +54,13 @@ is( $koha_calendar->is_holiday($custom_holiday), 0, '2013-11-10 does not start o $koha_calendar->add_holiday($custom_holiday); is( $koha_calendar->is_holiday($custom_holiday), 1, 'able to add holiday for testing' ); +my $today = dt_from_string(); +C4::Calendar->new( branchcode => 'CPL' )->insert_single_holiday( + day => $today->day(), + month => $today->month(), + year => $today->year(), + title => "$today", + description => "$today", +); +is( Koha::Calendar->new( branchcode => 'CPL' )->is_holiday( $today ), 1, "Today is a holiday for CPL" ); +is( Koha::Calendar->new( branchcode => 'MPL' )->is_holiday( $today ), 0, "Today is not a holiday for MPL"); -- 1.7.2.5