Bugzilla – Attachment 84599 Details for
Bug 22254
t/db_dependent/Koha/Patrons.t contains a DateTime math error
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 22254: Correction to datehandling in test
Bug-22254-Correction-to-datehandling-in-test.patch (text/plain), 2.05 KB, created by
Martin Renvoize (ashimema)
on 2019-02-01 09:57:29 UTC
(
hide
)
Description:
Bug 22254: Correction to datehandling in test
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2019-02-01 09:57:29 UTC
Size:
2.05 KB
patch
obsolete
>From dc1bd972cf286d326e3126cb409b87b24b9c1c6c Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Fri, 1 Feb 2019 09:55:54 +0000 >Subject: [PATCH] Bug 22254: Correction to datehandling in test > >Adding 13 months is not always the same as adding 1 month and then >adding 12 months in DateTime maths. This patch rectified the test >to match the correct behaviour in koha. >--- > t/db_dependent/Koha/Patrons.t | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > >diff --git a/t/db_dependent/Koha/Patrons.t b/t/db_dependent/Koha/Patrons.t >index 2cef9512d6..9fdce1914d 100644 >--- a/t/db_dependent/Koha/Patrons.t >+++ b/t/db_dependent/Koha/Patrons.t >@@ -263,16 +263,16 @@ subtest 'is_going_to_expire' => sub { > > > subtest 'renew_account' => sub { >- plan tests => 36; >+ plan tests => 48; > >- for my $date ( '2016-03-31', '2016-11-30', dt_from_string() ) { >+ for my $date ( '2016-03-31', '2016-11-30', '2019-01-31', dt_from_string() ) { > my $dt = dt_from_string( $date, 'iso' ); > Time::Fake->offset( $dt->epoch ); > my $a_month_ago = $dt->clone->subtract( months => 1, end_of_month => 'limit' )->truncate( to => 'day' ); > my $a_year_later = $dt->clone->add( months => 12, end_of_month => 'limit' )->truncate( to => 'day' ); >- my $a_year_later_minus_a_month = $dt->clone->add( months => 11, end_of_month => 'limit' )->truncate( to => 'day' ); >+ my $a_year_later_minus_a_month = $a_month_ago->clone->add( months => 12, end_of_month => 'limit' )->truncate( to => 'day' ); > my $a_month_later = $dt->clone->add( months => 1 , end_of_month => 'limit' )->truncate( to => 'day' ); >- my $a_year_later_plus_a_month = $dt->clone->add( months => 13, end_of_month => 'limit' )->truncate( to => 'day' ); >+ my $a_year_later_plus_a_month = $a_month_later->clone->add( months => 12, end_of_month => 'limit' )->truncate( to => 'day' ); > my $patron_category = $builder->build( > { source => 'Category', > value => { >-- >2.20.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 22254
:
84599
|
84600
|
84677