Bugzilla – Attachment 64911 Details for
Bug 9031
Overdue items crossing DST boundary throw invalid local time exception
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 9031 - Unit tests
Bug-9031---Unit-tests.patch (text/plain), 1.52 KB, created by
Nick Clemens (kidclamp)
on 2017-07-07 13:11:34 UTC
(
hide
)
Description:
Bug 9031 - Unit tests
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2017-07-07 13:11:34 UTC
Size:
1.52 KB
patch
obsolete
>From 6864bcd0e021e45f509e87dfdb6f4e93964b2bfb Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Fri, 7 Jul 2017 13:03:39 +0000 >Subject: [PATCH] Bug 9031 - Unit tests > >--- > t/db_dependent/Calendar.t | 19 ++++++++++++++++++- > 1 file changed, 18 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Calendar.t b/t/db_dependent/Calendar.t >index d443f11..751cd86 100644 >--- a/t/db_dependent/Calendar.t >+++ b/t/db_dependent/Calendar.t >@@ -17,12 +17,13 @@ > > use Modern::Perl; > >-use Test::More tests => 5; >+use Test::More tests => 6; > use t::lib::TestBuilder; > > use DateTime; > use Koha::Caches; > use Koha::DateUtils; >+use POSIX qw(tzset); > > use_ok('Koha::Calendar'); > >@@ -66,4 +67,20 @@ is($forwarded_dt->ymd, $today->ymd, '0 day should return start dt'); > $forwarded_dt = $calendar->days_forward($today, -2); > is($forwarded_dt->ymd, $today->ymd, 'negative day should return start dt'); > >+subtest 'crossing_DST' => sub { >+ >+ plan tests => 2; >+ >+ $ENV{TZ} = 'America/New_York'; >+ tzset; >+ my $tz = DateTime::TimeZone->new( name => 'local' ); >+ my $start_date = dt_from_string( "2016-03-09 02:29:00",undef,$tz ); >+ my $end_date = dt_from_string("2017-01-01"); >+ my $days_between = $calendar->days_between($start_date,$end_date); >+ is($days_between->{days}, 298, "Days calculated correctly"); >+ my $hours_between = $calendar->hours_between($start_date,$end_date); >+ is($hours_between->{minutes}, 428671, "Hours (in minutes) calculated correctly"); >+ >+}; >+ > $schema->storage->txn_rollback(); >-- >2.1.4
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 9031
:
13714
|
13795
|
61089
|
63718
|
64910
|
64911
|
68575
|
68576
|
68577
|
68578
|
68579
|
68580
|
68581
|
68582