Bugzilla – Attachment 166096 Details for
Bug 36567
Datetime warning in t/db_dependent/Circulation.t and t/db_dependent/Circulation/dateexpiry.t
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 36567: Get rid of Datetime warning in Circulation.t and dateexpiry.t
Bug-36567-Get-rid-of-Datetime-warning-in-Circulati.patch (text/plain), 2.73 KB, created by
Pedro Amorim
on 2024-05-03 09:21:21 UTC
(
hide
)
Description:
Bug 36567: Get rid of Datetime warning in Circulation.t and dateexpiry.t
Filename:
MIME Type:
Creator:
Pedro Amorim
Created:
2024-05-03 09:21:21 UTC
Size:
2.73 KB
patch
obsolete
>From e34095a58e41e3b52ce7e4bdd186cb091d794fc9 Mon Sep 17 00:00:00 2001 >From: Emmi Takkinen <emmi.takkinen@koha-suomi.fi> >Date: Wed, 10 Apr 2024 14:50:04 +0300 >Subject: [PATCH] Bug 36567: Get rid of Datetime warning in Circulation.t and > dateexpiry.t > >Running either t/db_dependent/Circulation.t or t/db_dependent/Circulation/dateexpiry.t >cause following error to be dispalyed: > >You are creating a DateTime object with a far future year (9999) and a time >zone (Europe/Helsinki). If the time zone you specified has future DST changes >this will be very slow. > >Smallest allowed value is 4999, so we need to use that rather than 9999 in tests. > >To test prove t/db_dependent/Circulation.t and t/db_dependent/Circulation/dateexpiry.t. > >Sponsored-by: Koha-Suomi Oy >Signed-off-by: David Nind <david@davidnind.com> >Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com> >--- > t/db_dependent/Circulation.t | 8 ++++---- > t/db_dependent/Circulation/dateexpiry.t | 2 +- > 2 files changed, 5 insertions(+), 5 deletions(-) > >diff --git a/t/db_dependent/Circulation.t b/t/db_dependent/Circulation.t >index 307db1d8a9..f37c3b8186 100755 >--- a/t/db_dependent/Circulation.t >+++ b/t/db_dependent/Circulation.t >@@ -2464,8 +2464,8 @@ subtest 'AddIssue & illrequests.due_date' => sub { > > set_userenv($library); > >- my $custom_date_due = '9999-12-18 12:34:56'; >- my $expected_date_due = '9999-12-18 23:59:00'; >+ my $custom_date_due = '4999-12-18 12:34:56'; >+ my $expected_date_due = '4999-12-18 23:59:00'; > my $illrequest = Koha::ILL::Request->new({ > borrowernumber => $patron->borrowernumber, > biblio_id => $item->biblionumber, >@@ -2478,8 +2478,8 @@ subtest 'AddIssue & illrequests.due_date' => sub { > > $patron = $builder->build_object( { class => 'Koha::Patrons' } ); > $item = $builder->build_sample_item(); >- $custom_date_due = '9999-12-19'; >- $expected_date_due = '9999-12-19 23:59:00'; >+ $custom_date_due = '4999-12-19'; >+ $expected_date_due = '4999-12-19 23:59:00'; > $illrequest = Koha::ILL::Request->new({ > borrowernumber => $patron->borrowernumber, > biblio_id => $item->biblionumber, >diff --git a/t/db_dependent/Circulation/dateexpiry.t b/t/db_dependent/Circulation/dateexpiry.t >index 79ba9e0a02..f992219687 100755 >--- a/t/db_dependent/Circulation/dateexpiry.t >+++ b/t/db_dependent/Circulation/dateexpiry.t >@@ -124,7 +124,7 @@ sub calc_date_due { > is( ref $d eq "DateTime" && $d->mdy() =~ /^\d+/, 1, "CalcDateDue with expiry tomorrow" ); > > # fourth test far future >- $patron->dateexpiry('9876-12-31')->store; >+ $patron->dateexpiry('4999-12-31')->store; > my $t1 = time; > $d = C4::Circulation::CalcDateDue( $today, $item->effective_itemtype, $branch->{branchcode}, $patron ); > my $t2 = time; >-- >2.39.2
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 36567
:
164609
|
165635
|
165636
| 166096