Bugzilla – Attachment 94652 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.16 KB, created by
Jonathan Druart
on 2019-10-24 10:31:21 UTC
(
hide
)
Description:
Bug 23234: Mock DateTime->now using the time zone
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2019-10-24 10:31:21 UTC
Size:
1.16 KB
patch
obsolete
>From 7cb469e6a5f78b0ac2920bd57b9db8001d4162e9 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 >--- > 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 f0086a0e73..ef54928a24 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.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 23234
:
94652
|
95025