From 2a574753feac5f872f94a6323415b2d68c9ddd8d Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Thu, 30 Oct 2014 12:04:34 -0400 Subject: [PATCH] Bug 8133 [QA Followup 2] - Fix unit tests --- t/db_dependent/Calendar.t | 8 ++++++++ t/db_dependent/Holidays.t | 12 ++++++++++++ 2 files changed, 20 insertions(+), 0 deletions(-) diff --git a/t/db_dependent/Calendar.t b/t/db_dependent/Calendar.t index a55bb1d..aef7507 100644 --- a/t/db_dependent/Calendar.t +++ b/t/db_dependent/Calendar.t @@ -3,6 +3,14 @@ use Modern::Perl; use Test::More tests => 18; use C4::Calendar; +use C4::Context; + +my $dbh = C4::Context->dbh(); +$dbh->{AutoCommit} = 0; +$dbh->{RaiseError} = 1; + +$dbh->do("DELETE FROM calendar_events"); +$dbh->do("DELETE FROM calendar_repeats"); my $new_holiday = { open_hour => 0, open_minute => 0, diff --git a/t/db_dependent/Holidays.t b/t/db_dependent/Holidays.t index 3541e98..fc44a1c 100755 --- a/t/db_dependent/Holidays.t +++ b/t/db_dependent/Holidays.t @@ -7,6 +7,8 @@ use DateTime::TimeZone; use C4::Context; use Test::More tests => 6; +use C4::Calendar; + BEGIN { use_ok('Koha::Calendar'); } my $dbh = C4::Context->dbh(); @@ -14,6 +16,16 @@ my $dbh = C4::Context->dbh(); $dbh->{AutoCommit} = 0; $dbh->{RaiseError} = 1; +my $sundays = { open_hour => 0, + open_minute => 0, + close_hour => 0, + close_minute => 0, + title => 'Closed on Sundays', + description => 'This is an example holiday used for testing' }; + +# Make Sunday a closed day +ModRepeatingEvent( 'MPL', 0, undef, undef, $sundays ); + my $branchcode = 'MPL'; my $koha_calendar = Koha::Calendar->new( branchcode => $branchcode ); -- 1.7.2.5