Bugzilla – Attachment 66888 Details for
Bug 11580
If returnBeforeExpiry is on, holidays are not taken into account to calculate the due date
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 11580: Add one more test and clear the cache
Bug-11580-Add-one-more-test-and-clear-the-cache.patch (text/plain), 2.22 KB, created by
Jonathan Druart
on 2017-09-06 15:53:51 UTC
(
hide
)
Description:
Bug 11580: Add one more test and clear the cache
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2017-09-06 15:53:51 UTC
Size:
2.22 KB
patch
obsolete
>From daeb5cf5154a9fa03911f7359d5cb6446b379a13 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 6 Sep 2017 12:52:46 -0300 >Subject: [PATCH] Bug 11580: Add one more test and clear the cache > >Make sure we are not just returning J-1 and clear the cache before and >after the tests. >--- > t/db_dependent/Circulation/CalcDateDue.t | 15 ++++++++++++++- > 1 file changed, 14 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Circulation/CalcDateDue.t b/t/db_dependent/Circulation/CalcDateDue.t >index 98efd48..c6b6b52 100644 >--- a/t/db_dependent/Circulation/CalcDateDue.t >+++ b/t/db_dependent/Circulation/CalcDateDue.t >@@ -2,7 +2,7 @@ > > use Modern::Perl; > >-use Test::More tests => 6; >+use Test::More tests => 7; > use Test::MockModule; > use DBI; > use DateTime; >@@ -36,6 +36,9 @@ Koha::Database->schema->resultset('Issuingrule')->create({ > t::lib::Mocks::mock_preference('ReturnBeforeExpiry', 1); > t::lib::Mocks::mock_preference('useDaysMode', 'Days'); > >+my $cache = Koha::Caches->get_instance(); >+$cache->clear_from_cache('single_holidays'); >+ > my $dateexpiry = '2013-01-01'; > > my $borrower = {categorycode => 'B', dateexpiry => $dateexpiry}; >@@ -66,6 +69,15 @@ $calendar->insert_single_holiday( > ); > $date = C4::Circulation::CalcDateDue( $start_date, $itemtype, $branchcode, $borrower ); > is($date, '2012-12-31T23:59:00', 'date expiry should be 2013-01-01 -1 day'); >+$calendar->insert_single_holiday( >+ day => 31, >+ month => 12, >+ year => 2012, >+ title =>'holidayTest', >+ description => 'holidayDesc' >+); >+$date = C4::Circulation::CalcDateDue( $start_date, $itemtype, $branchcode, $borrower ); >+is($date, '2012-12-30T23:59:00', 'date expiry should be 2013-01-01 -2 day'); > > > $date = C4::Circulation::CalcDateDue( $start_date, $itemtype, $branchcode, $borrower, 1 ); >@@ -83,4 +95,5 @@ is($date, '2013-02-' . (9 + $issuelength) . 'T23:59:00', "date expiry ( 9 + $iss > $date = C4::Circulation::CalcDateDue( $start_date, $itemtype, $branchcode, $borrower, 1 ); > is($date, '2013-02-' . (9 + $renewalperiod) . 'T23:59:00', "date expiry ( 9 + $renewalperiod )"); > >+$cache->clear_from_cache('single_holidays'); > $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 11580
:
57562
|
58740
|
60621
|
64681
|
65779
|
65780
|
66705
|
66706
|
66707
|
66886
| 66888