Bugzilla – Attachment 95025 Details for
Bug 23234
Circulation.t failing when comparing dates that seem identical
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 23234: Mock DateTime->now using the time zone
Bug-23234-Mock-DateTime-now-using-the-time-zone.patch (text/plain), 1.22 KB, created by
Martin Renvoize (ashimema)
on 2019-11-04 17:24:58 UTC
(
hide
)
Description:
Bug 23234: Mock DateTime->now using the time zone
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2019-11-04 17:24:58 UTC
Size:
1.22 KB
patch
obsolete
>From ae65f876ff32d0ea07d134ff0ef5ed5e5ed17e0e Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Thu, 24 Oct 2019 12:29:23 +0200 >Subject: [PATCH] Bug 23234: Mock DateTime->now using the time zone > >The timezone of the two dt was different, one was UTC, the other one was >my local one. >When we mocked DateTime->now we did not use the time zone, we must use >dt_from_string instead > >Test plan: >Make sure your environment has a different time zone than UTC >`prove t/db_dependent/Circulation.t` should fail without this patch > >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > t/db_dependent/Circulation.t | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > >diff --git a/t/db_dependent/Circulation.t b/t/db_dependent/Circulation.t >index e323508469..af439b71f0 100755 >--- a/t/db_dependent/Circulation.t >+++ b/t/db_dependent/Circulation.t >@@ -101,7 +101,7 @@ my $builder = t::lib::TestBuilder->new; > my $dbh = C4::Context->dbh; > > # Prevent random failures by mocking ->now >-my $now_value = DateTime->now(); >+my $now_value = dt_from_string; > my $mocked_datetime = Test::MockModule->new('DateTime'); > $mocked_datetime->mock( 'now', sub { return $now_value->clone; } ); > >-- >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 23234
:
94652
| 95025