Bugzilla – Attachment 37401 Details for
Bug 13933
t/DateUtils.t causes the build to break (from bug 13601)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 13933: Fix t/DateUtils.t without DB
Bug-13933-Fix-tDateUtilst-without-DB.patch (text/plain), 1.85 KB, created by
Nicolas Legrand
on 2015-03-31 08:08:04 UTC
(
hide
)
Description:
Bug 13933: Fix t/DateUtils.t without DB
Filename:
MIME Type:
Creator:
Nicolas Legrand
Created:
2015-03-31 08:08:04 UTC
Size:
1.85 KB
patch
obsolete
>From ab0107497378561bd04d886c62e6c5887f4c8222 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@biblibre.com> >Date: Tue, 31 Mar 2015 09:56:56 +0200 >Subject: [PATCH] Bug 13933: Fix t/DateUtils.t without DB > >If the mysql server is not running, the DateUtils.t tests failed. >This is caused by > >commit dd9f456ab7c2f0e66173a6feb7df2a38604c82cd > Bug 13601: Add tests to highlight the problems with > DateTime::Format::DateParse > >The pref dateformat and TimeFormat were retrieved before the mock. >Before bug 13601, the complete preference method was mocked, that's why >the error did not appear. > >Test plan: > sudo service mysql stop > prove t/DateUtils.t >should be happy > >Signed-off-by: Nicolas Legrand <nicolas.legrand@bulac.fr> >--- > t/DateUtils.t | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > >diff --git a/t/DateUtils.t b/t/DateUtils.t >index 1af4268..4f7c773 100755 >--- a/t/DateUtils.t >+++ b/t/DateUtils.t >@@ -10,6 +10,9 @@ use t::lib::Mocks; > > BEGIN { use_ok('Koha::DateUtils'); } > >+t::lib::Mocks::mock_preference('dateformat', 'us'); >+t::lib::Mocks::mock_preference('TimeFormat', 'This_is_not_used_but_called'); >+ > my $tz = C4::Context->tz; > > isa_ok( $tz, 'DateTime::TimeZone', 'Context returns timezone object' ); >@@ -26,10 +29,6 @@ $dt->set_minute(0); > > my $date_string; > >-my $module_context = new Test::MockModule('C4::Context'); >- >-t::lib::Mocks::mock_preference('dateformat', 'us'); >- > my $dateformat = C4::Context->preference('dateformat'); > cmp_ok output_pref({ dt => $dt, dateformat => $dateformat }), > 'eq', >@@ -160,6 +159,7 @@ cmp_ok $date_string, 'eq', '12/11/2013 06:35 PM', 'as_due_date with hours and ti > my $now = DateTime->now; > is( dt_from_string, $now, "Without parameter, dt_from_string should return today" ); > >+my $module_context = new Test::MockModule('C4::Context'); > $module_context->mock( > 'tz', > sub { >-- >1.7.10.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 13933
:
37400
|
37401
|
37422
|
37436