Bugzilla – Attachment 74175 Details for
Bug 20584
Koha/Patron/Categories.t is failing on slow servers
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 20584: Prevent Koha/Patron/Categories.t to fail randomly
Bug-20584-Prevent-KohaPatronCategoriest-to-fail-ra.patch (text/plain), 2.28 KB, created by
Jonathan Druart
on 2018-04-13 18:11:13 UTC
(
hide
)
Description:
Bug 20584: Prevent Koha/Patron/Categories.t to fail randomly
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2018-04-13 18:11:13 UTC
Size:
2.28 KB
patch
obsolete
>From c9dade8852caab3479204f2995826a2e970bca3a Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Fri, 13 Apr 2018 15:09:53 -0300 >Subject: [PATCH] Bug 20584: Prevent Koha/Patron/Categories.t to fail randomly > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >--- > t/db_dependent/Koha/Patron/Categories.t | 7 ++++--- > 1 file changed, 4 insertions(+), 3 deletions(-) > >diff --git a/t/db_dependent/Koha/Patron/Categories.t b/t/db_dependent/Koha/Patron/Categories.t >index 6a0171f359..58882a493e 100644 >--- a/t/db_dependent/Koha/Patron/Categories.t >+++ b/t/db_dependent/Koha/Patron/Categories.t >@@ -26,6 +26,7 @@ use Koha::Database; > use Koha::DateUtils; > use Koha::Patron::Category; > use Koha::Patron::Categories; >+use t::lib::Dates; > use t::lib::TestBuilder; > use t::lib::Mocks; > >@@ -75,11 +76,11 @@ subtest 'get_expiry_date' => sub { > is( $category->get_expiry_date( $next_year ), $next_month, 'Without enrolmentperiod, ->get_expiry_date should return enrolmentperiodadate even if a parameter is given' ); > > $category->enrolmentperiod( 12 )->store; >- is( $category->get_expiry_date, $next_year, 'With enrolmentperiod defined and no parameter, ->get_expiry_date should return today + enrolmentperiod' ); >- is( $category->get_expiry_date( $yesterday ), $next_year->clone->add( days => -1 ), 'With enrolmentperiod defined and a date given in parameter, ->get_expiry_date should take this date + enrolmentperiod' ); >+ is( t::lib::Dates::compare($category->get_expiry_date, $next_year), 0, 'With enrolmentperiod defined and no parameter, ->get_expiry_date should return today + enrolmentperiod' ); >+ is( t::lib::Dates::compare($category->get_expiry_date( $yesterday ), $next_year->clone->add( days => -1 )), 0, 'With enrolmentperiod defined and a date given in parameter, ->get_expiry_date should take this date + enrolmentperiod' ); > > my $hardcoded_date = '2000-01-31'; >- is( $category->get_expiry_date( $hardcoded_date ), dt_from_string( $hardcoded_date )->add( months => 12 ), 'get_expiry_date accepts strings as well' ); >+ is( t::lib::Dates::compare($category->get_expiry_date( $hardcoded_date ), dt_from_string( $hardcoded_date )->add( months => 12 )), 0, 'get_expiry_date accepts strings as well' ); > > $category->delete; > }; >-- >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 20584
: 74175