Bugzilla – Attachment 51666 Details for
Bug 16539
Koha::Cache is incorrectly caching single holidays
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 16539: Add tests
Bug-16539-Add-tests.patch (text/plain), 2.31 KB, created by
Jonathan Druart
on 2016-05-20 15:55:47 UTC
(
hide
)
Description:
Bug 16539: Add tests
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2016-05-20 15:55:47 UTC
Size:
2.31 KB
patch
obsolete
>From de3fe41a7bca10dfbbfb7d17291e44df7f780097 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 18 May 2016 15:01:03 +0100 >Subject: [PATCH] Bug 16539: Add tests > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >--- > t/Calendar.t | 16 +++++++++++++++- > 1 file changed, 15 insertions(+), 1 deletion(-) > >diff --git a/t/Calendar.t b/t/Calendar.t >index 37f11f4..4d48c02 100755 >--- a/t/Calendar.t >+++ b/t/Calendar.t >@@ -29,7 +29,7 @@ use Module::Load::Conditional qw/check_install/; > > BEGIN { > if ( check_install( module => 'Test::DBIx::Class' ) ) { >- plan tests => 35; >+ plan tests => 38; > } else { > plan skip_all => "Need Test::DBIx::Class" > } >@@ -85,6 +85,7 @@ fixtures_ok [ > [ 'MPL', 11, 11, 2012, '', '', 1 ], # sunday exception > [ 'MPL', 1, 6, 2011, '', '', 0 ], > [ 'MPL', 4, 7, 2012, '', '', 0 ], >+ [ 'CPL', 6, 8, 2012, '', '', 0 ], > ], > ], "add fixtures"; > >@@ -144,6 +145,12 @@ my $day_after_christmas = DateTime->new( > day => 26 > ); # for testing negative addDate > >+my $holiday_for_another_branch = DateTime->new( >+ year => 2012, >+ month => 8, >+ day => 6, # This is a monday >+); >+ > { # Syspref-agnostic tests > is ( $saturday->day_of_week, 6, '\'$saturday\' is actually a saturday (6th day of week)'); > is ( $sunday->day_of_week, 7, '\'$sunday\' is actually a sunday (7th day of week)'); >@@ -155,6 +162,7 @@ my $day_after_christmas = DateTime->new( > is ( $cal->is_holiday($single_holiday), 1, 'Single holiday closed day test' ); > is ( $cal->is_holiday($notspecial), 0, 'Fixed single date that is not a holiday test' ); > is ( $cal->is_holiday($sunday_exception), 0, 'Exception holiday is not a closed day test' ); >+ is ( $cal->is_holiday($holiday_for_another_branch), 0, 'Holiday defined for another branch should not be defined as an holiday' ); > } > > { # Bugzilla #8966 - is_holiday truncates referenced date >@@ -321,4 +329,10 @@ my $day_after_christmas = DateTime->new( > > } > >+{ >+ $cal = Koha::Calendar->new( branchcode => 'CPL' ); >+ is ( $cal->is_holiday($single_holiday), 0, 'Single holiday for MPL, not CPL' ); >+ is ( $cal->is_holiday($holiday_for_another_branch), 1, 'Holiday defined for CPL should be defined as an holiday' ); >+} >+ > 1; >-- >2.8.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 16539
:
51585
|
51587
|
51588
|
51593
|
51664
|
51665
| 51666