Bugzilla – Attachment 106968 Details for
Bug 26000
Holiday exceptions are incorrectly cached for an individual branch
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 26000: Unit test
Bug-26000-Unit-test.patch (text/plain), 2.27 KB, created by
Nick Clemens (kidclamp)
on 2020-07-16 19:37:33 UTC
(
hide
)
Description:
Bug 26000: Unit test
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2020-07-16 19:37:33 UTC
Size:
2.27 KB
patch
obsolete
>From 27f7a06ba838effb9bc249106aa562163101af2b Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Thu, 16 Jul 2020 19:30:28 +0000 >Subject: [PATCH] Bug 26000: Unit test > >--- > t/db_dependent/Holidays.t | 32 ++++++++++++++++++++++++++++++-- > 1 file changed, 30 insertions(+), 2 deletions(-) > >diff --git a/t/db_dependent/Holidays.t b/t/db_dependent/Holidays.t >index 023c4a89ff..f9853ab1ea 100755 >--- a/t/db_dependent/Holidays.t >+++ b/t/db_dependent/Holidays.t >@@ -39,10 +39,39 @@ my $builder = t::lib::TestBuilder->new; > > subtest 'exception_holidays() tests' => sub { > >- plan tests => 1; >+ plan tests => 2; > > $schema->storage->txn_begin; > >+ my $branch = $builder->build( { source => 'Branch' } )->{branchcode}; >+ my $branch2 = $builder->build( { source => 'Branch' } )->{branchcode}; >+ >+ $dbh->do("DELETE FROM special_holidays"); >+ # Clear cache >+ Koha::Caches->get_instance->flush_all; >+ >+ my $holiday2add = dt_from_string("2030-07-07"); >+ C4::Calendar->new( branchcode => $branch )->insert_day_month_holiday( >+ day => $holiday2add->day(), >+ month => $holiday2add->month(), >+ year => $holiday2add->year(), >+ title => 'A holiday', >+ description => "This is a holiday, for now", >+ ); >+ >+ C4::Calendar->new( branchcode => $branch )->insert_exception_holiday( >+ day => 7, >+ month => 7, >+ year => 2020, >+ title => 'Not a holiday', >+ description => 'This date should not be a holiday', >+ ); >+ >+ my $calendar = Koha::Calendar->new( branchcode => $branch2 ); >+ $calendar->exception_holidays(); #This sets exception holiday in cache >+ $calendar = Koha::Calendar->new( branchcode => $branch ); >+ is( $calendar->is_holiday( dt_from_string('2020-07-07') ), 0, "The date is not a holiday"); >+ > $dbh->do("DELETE FROM special_holidays"); > # Clear cache > Koha::Caches->get_instance->flush_all; >@@ -53,7 +82,6 @@ subtest 'exception_holidays() tests' => sub { > use POSIX qw(tzset); > tzset; > >- my $branch = $builder->build( { source => 'Branch' } )->{branchcode}; > my $calendar = Koha::Calendar->new( branchcode => $branch ); > > C4::Calendar->new( branchcode => $branch )->insert_exception_holiday( >-- >2.11.0
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 26000
:
106968
|
106969
|
106987
|
107746
|
107747
|
107762
|
107763