Bugzilla – Attachment 107020 Details for
Bug 25723
Improve efficiency of holiday calculation
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 25723: Remove tests for removed method
Bug-25723-Remove-tests-for-removed-method.patch (text/plain), 3.20 KB, created by
Joonas Kylmälä
on 2020-07-17 14:42:42 UTC
(
hide
)
Description:
Bug 25723: Remove tests for removed method
Filename:
MIME Type:
Creator:
Joonas Kylmälä
Created:
2020-07-17 14:42:42 UTC
Size:
3.20 KB
patch
obsolete
>From 4a49578d54057f7ec8fe38316c35e06dcac1ef6a Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Wed, 17 Jun 2020 13:46:34 +0100 >Subject: [PATCH] Bug 25723: Remove tests for removed method >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >We removed the exception_holidays (and single_holidays) methods as part >of this patchset. As such, we should no longer test them ;) > >Signed-off-by: Emma Perks <Emma.Perks2@uhb.nhs.uk> >Signed-off-by: Nick Clemens <nick@bywatersolutions.com> >Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi> >--- > t/db_dependent/Holidays.t | 45 ++------------------------------------------- > 1 file changed, 2 insertions(+), 43 deletions(-) > >diff --git a/t/db_dependent/Holidays.t b/t/db_dependent/Holidays.t >index 5b3ecb0948..ced8bd538b 100755 >--- a/t/db_dependent/Holidays.t >+++ b/t/db_dependent/Holidays.t >@@ -17,7 +17,7 @@ > > use Modern::Perl; > >-use Test::More tests => 17; >+use Test::More tests => 12; > > use DateTime; > use DateTime::TimeZone; >@@ -37,7 +37,7 @@ my $schema = Koha::Database->new->schema; > my $dbh = C4::Context->dbh; > my $builder = t::lib::TestBuilder->new; > >-subtest 'exception_holidays() tests' => sub { >+subtest 'is_holiday timezone tests' => sub { > > plan tests => 1; > >@@ -160,47 +160,6 @@ C4::Calendar->new( branchcode => $branch_2 )->insert_single_holiday( > is( Koha::Calendar->new( branchcode => $branch_2 )->is_holiday( $today ), 1, "Today is a holiday for $branch_2" ); > is( Koha::Calendar->new( branchcode => $branch_1 )->is_holiday( $today ), 0, "Today is not a holiday for $branch_1"); > >-# Few tests for exception holidays >-my ( $diff, $cal, $special ); >-$dbh->do("DELETE FROM special_holidays"); >-_add_exception( $today, $branch_1, 'Today' ); >-$cal = Koha::Calendar->new( branchcode => $branch_1 ); >-$special = $cal->exception_holidays; >-is( keys %{$special}, 1, 'One exception holiday added' ); >- >-my $tomorrow= dt_from_string(); >-$tomorrow->add_duration( DateTime::Duration->new(days => 1) ); >-_add_exception( $tomorrow, $branch_1, 'Tomorrow' ); >-$cal = Koha::Calendar->new( branchcode => $branch_1 ); >-$special = $cal->exception_holidays; >-is( keys %{$special}, 2, 'Set of exception holidays contains two dates' ); >- >-$diff = $today->delta_days( $today )->in_units('days'); >-is( $diff, 0, 'Lowest exception holiday is today' ); >-$diff = $tomorrow->delta_days( $tomorrow )->in_units('days'); >-is( $diff, 0, 'Highest exception holiday is tomorrow' ); >- >-C4::Calendar->new( branchcode => $branch_1 )->delete_holiday( >- weekday => $tomorrow->day_of_week, >- day => $tomorrow->day, >- month => $tomorrow->month, >- year => $tomorrow->year, >-); >-$cal = Koha::Calendar->new( branchcode => $branch_1 ); >-$special = $cal->exception_holidays; >-is( keys %{$special}, 1, 'Set of exception holidays back to one' ); >- >-sub _add_exception { >- my ( $dt, $branch, $descr ) = @_; >- C4::Calendar->new( branchcode => $branch )->insert_exception_holiday( >- day => $dt->day, >- month => $dt->month, >- year => $dt->year, >- title => $descr, >- description => $descr, >- ); >-} >- > $schema->storage->txn_rollback; > > subtest 'copy_to_branch' => sub { >-- >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 25723
:
105789
|
105792
|
105793
|
105830
|
105831
|
105832
|
105833
|
105834
|
105835
|
105836
|
105936
|
105937
|
105939
|
105941
|
105947
|
105954
|
105955
|
105956
|
105957
|
105958
|
105959
|
105960
|
105961
|
105962
|
105963
|
105964
|
105965
|
105966
|
105967
|
105968
|
105969
|
105970
|
106991
|
106992
|
106993
|
106994
|
106995
|
106996
|
106997
|
106998
|
106999
|
107000
|
107001
|
107002
|
107003
|
107004
|
107005
|
107006
|
107007
|
107008
|
107009
|
107010
|
107013
|
107014
|
107015
|
107016
|
107017
|
107018
|
107019
| 107020 |
107021
|
107022
|
107023
|
107025