Bugzilla – Attachment 34379 Details for
Bug 13451
Holidays.t assumes default data
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[PASSED QA] Bug 13451: Holidays.t assumes default data
PASSED-QA-Bug-13451-Holidayst-assumes-default-data.patch (text/plain), 2.92 KB, created by
Katrin Fischer
on 2014-12-14 20:15:48 UTC
(
hide
)
Description:
[PASSED QA] Bug 13451: Holidays.t assumes default data
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2014-12-14 20:15:48 UTC
Size:
2.92 KB
patch
obsolete
>From cdce207f532acee63cde3546dad8c64f6c2395f2 Mon Sep 17 00:00:00 2001 >From: Mark Tompsett <mtompset@hotmail.com> >Date: Fri, 12 Dec 2014 11:51:38 -0500 >Subject: [PATCH] [PASSED QA] Bug 13451: Holidays.t assumes default data > >This patch removes that assumption by expressly setting data >to be default. > >TEST PLAN >--------- >1) Ensure that branch code is NOT 'MPL' in the > repeatable_holidays table in your database. >2) Ensure that branch codes 'MPL' and 'CPL' do not exist > in the branches table in your database. >3) prove t/db_dependent/Holidays.t > -- this should bomb horribly. >4) Apply patch >5) prove t/db_dependent/Holidays.t > -- all tests should succeed. >6) run koha qa tests > >Signed-off-by: Nick Clemens <nick@quecheelibrary.org> >Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de> >Tests pass without holidays in the calendar. >--- > t/db_dependent/Holidays.t | 35 +++++++++++++++++++++++++++++++++++ > 1 file changed, 35 insertions(+) > >diff --git a/t/db_dependent/Holidays.t b/t/db_dependent/Holidays.t >index 75bbc1c..dc7e5a6 100755 >--- a/t/db_dependent/Holidays.t >+++ b/t/db_dependent/Holidays.t >@@ -7,6 +7,7 @@ use DateTime::TimeZone; > use C4::Context; > use Koha::DateUtils; > use Test::More tests => 12; >+use C4::Branch; > > BEGIN { use_ok('Koha::Calendar'); } > BEGIN { use_ok('C4::Calendar'); } >@@ -16,6 +17,38 @@ my $dbh = C4::Context->dbh(); > $dbh->{AutoCommit} = 0; > $dbh->{RaiseError} = 1; > >+# Add branches if they don't exist >+if (not defined GetBranchDetail('CPL')) { >+ ModBranch({add => 1, branchcode => 'CPL', branchname => 'Centerville'}); >+} >+if (not defined GetBranchDetail('MPL')) { >+ ModBranch({add => 1, branchcode => 'MPL', branchname => 'Midway'}); >+} >+ >+# Make the repeatable_holidays table ONLY the default data. >+$dbh->do("DELETE FROM repeatable_holidays"); >+C4::Calendar->new( branchcode => 'MPL' )->insert_week_day_holiday( >+ weekday => 0, >+ title => '', >+ description => 'Sundays', >+); >+my $holiday2add = dt_from_string("2015-01-01"); >+C4::Calendar->new( branchcode => 'MPL' )->insert_day_month_holiday( >+ day => $holiday2add->day(), >+ month => $holiday2add->month(), >+ year => $holiday2add->year(), >+ title => '', >+ description => "New Year's Day", >+); >+$holiday2add = dt_from_string("2014-12-25"); >+C4::Calendar->new( branchcode => 'MPL' )->insert_day_month_holiday( >+ day => $holiday2add->day(), >+ month => $holiday2add->month(), >+ year => $holiday2add->year(), >+ title => '', >+ description => 'Christmas', >+); >+ > my $branchcode = 'MPL'; > > my $koha_calendar = Koha::Calendar->new( branchcode => $branchcode ); >@@ -72,3 +105,5 @@ C4::Calendar->new( branchcode => 'CPL' )->insert_single_holiday( > ); > 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"); >+ >+$dbh->rollback; >-- >1.9.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 13451
:
34359
|
34377
| 34379