Bugzilla – Attachment 11248 Details for
Bug 8486
Critical error in Koha::Calendar::days_between calculation
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 8486 - Follow up making the tests db independent
Bug-8486---Follow-up-making-the-tests-db-independe.patch (text/plain), 2.82 KB, created by
Paul Poulain
on 2012-08-01 10:38:04 UTC
(
hide
)
Description:
Bug 8486 - Follow up making the tests db independent
Filename:
MIME Type:
Creator:
Paul Poulain
Created:
2012-08-01 10:38:04 UTC
Size:
2.82 KB
patch
obsolete
>From d434be61e25f0be9b2d2102ab134ecbdae020cc3 Mon Sep 17 00:00:00 2001 >From: Chris Cormack <chrisc@catalyst.net.nz> >Date: Sat, 28 Jul 2012 20:07:36 +1200 >Subject: [PATCH] Bug 8486 - Follow up making the tests db independent > >Signed-off-by: Paul Poulain <paul.poulain@biblibre.com> >Makes the test db independant by specifying the date format. Thus, there is no call to ->preference() that retrieve a systempreference >--- > t/Calendar.t | 28 ++++++++++++++-------------- > 1 file changed, 14 insertions(+), 14 deletions(-) > >diff --git a/t/Calendar.t b/t/Calendar.t >index d47e104..283300e 100755 >--- a/t/Calendar.t >+++ b/t/Calendar.t >@@ -106,24 +106,24 @@ $cal->set_daysmode('Calendar'); > # example tests for bug report > $cal->clear_weekly_closed_days(); > >-$daycount = $cal->days_between( dt_from_string('2012-01-10'), >- dt_from_string("2012-05-05") )->in_units('days'); >+$daycount = $cal->days_between( dt_from_string('2012-01-10','iso'), >+ dt_from_string("2012-05-05",'iso') )->in_units('days'); > cmp_ok( $daycount, '==', 116, 'test larger intervals' ); >-$daycount = $cal->days_between( dt_from_string("2012-01-01"), >- dt_from_string("2012-05-05") )->in_units('days'); >+$daycount = $cal->days_between( dt_from_string("2012-01-01",'iso'), >+ dt_from_string("2012-05-05",'iso') )->in_units('days'); > cmp_ok( $daycount, '==', 125, 'test positive intervals' ); >-my $daycount2 = $cal->days_between( dt_from_string("2012-05-05"), >- dt_from_string("2012-01-01") )->in_units('days'); >+my $daycount2 = $cal->days_between( dt_from_string("2012-05-05",'iso'), >+ dt_from_string("2012-01-01",'iso') )->in_units('days'); > cmp_ok( $daycount2, '==', $daycount, 'test parameter order not relevant' ); >-$daycount = $cal->days_between( dt_from_string("2012-07-01"), >- dt_from_string("2012-07-15") )->in_units('days'); >+$daycount = $cal->days_between( dt_from_string("2012-07-01",'iso'), >+ dt_from_string("2012-07-15",'iso') )->in_units('days'); > cmp_ok( $daycount, '==', 14, 'days_between calculates correctly' ); >-$cal->add_holiday( dt_from_string('2012-07-06') ); >-$daycount = $cal->days_between( dt_from_string("2012-07-01"), >- dt_from_string("2012-07-15") )->in_units('days'); >+$cal->add_holiday( dt_from_string('2012-07-06','iso') ); >+$daycount = $cal->days_between( dt_from_string("2012-07-01",'iso'), >+ dt_from_string("2012-07-15",'iso') )->in_units('days'); > cmp_ok( $daycount, '==', 13, 'holiday correctly recognized' ); > >-$cal->add_holiday( dt_from_string('2012-07-07') ); >-$daycount = $cal->days_between( dt_from_string("2012-07-01"), >- dt_from_string("2012-07-15") )->in_units('days'); >+$cal->add_holiday( dt_from_string('2012-07-07','iso') ); >+$daycount = $cal->days_between( dt_from_string("2012-07-01",'iso'), >+ dt_from_string("2012-07-15",'iso') )->in_units('days'); > cmp_ok( $daycount, '==', 12, 'multiple holidays correctly recognized' ); >-- >1.7.9.5
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 8486
:
11111
|
11121
|
11174
|
11179
| 11248