Bugzilla – Attachment 133292 Details for
Bug 30540
Double processing invalid dates can lead to ISE
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 30540: Unit test
Bug-30540-Unit-test.patch (text/plain), 1.61 KB, created by
Martin Renvoize (ashimema)
on 2022-04-14 09:22:09 UTC
(
hide
)
Description:
Bug 30540: Unit test
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2022-04-14 09:22:09 UTC
Size:
1.61 KB
patch
obsolete
>From ceae8d1b1f5194c7e10449b949e1af345a034668 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Thu, 14 Apr 2022 10:19:47 +0100 >Subject: [PATCH] Bug 30540: Unit test > >This patch adds tests for checking the output_pref method against >a timezone and datetime that would cause an Invalid local time failure > >To test: >1. Apply this patch >2. Run: > $ kshell > k$ prove t/DateUtils.t >=> FAIL: The feature is not implemented, tests fail to complete >--- > t/DateUtils.t | 18 +++++++++++++++++- > 1 file changed, 17 insertions(+), 1 deletion(-) > >diff --git a/t/DateUtils.t b/t/DateUtils.t >index 97cffd7509..ae39782321 100755 >--- a/t/DateUtils.t >+++ b/t/DateUtils.t >@@ -4,7 +4,7 @@ use DateTime::TimeZone; > > use C4::Context; > >-use Test::More tests => 81; >+use Test::More tests => 82; > > use Test::MockModule; > use Test::Warn; >@@ -262,6 +262,22 @@ $module_context->mock( > $dt = dt_from_string('2014-03-30 02:00:00'); > isa_ok( $dt, 'DateTime', 'dt_from_string should return a DateTime object if a DST is given' ); > >+# Test output_pref for invalid local time explosion >+$dt = DateTime->new( >+ year => 2017, >+ month => 03, >+ day => 26, >+ hour => 01, >+ minute => 35, >+); >+$module_context->mock( >+ 'tz', >+ sub { >+ return DateTime::TimeZone->new( name => 'Europe/London' ); >+ } >+); >+is( output_pref( { dt => $dt, dateonly => 0 } ), '03/26/2017 01:35', 'output_pref should return even if an invalid DST time is passed' ); >+ > # Test dt_from_string > t::lib::Mocks::mock_preference('dateformat', 'metric'); > t::lib::Mocks::mock_preference('TimeFormat', '24hr'); >-- >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 30540
:
133290
|
133292
|
133293
|
133297
|
133298
|
133299
|
133336
|
133337
|
133338