Bugzilla – Attachment 61440 Details for
Bug 12063
Change date calculation for reserve expiration to skip all holidays
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 12063 - Fix unit tests
Bug-12063---Fix-unit-tests.patch (text/plain), 2.82 KB, created by
Alex Arnaud
on 2017-03-22 12:56:21 UTC
(
hide
)
Description:
Bug 12063 - Fix unit tests
Filename:
MIME Type:
Creator:
Alex Arnaud
Created:
2017-03-22 12:56:21 UTC
Size:
2.82 KB
patch
obsolete
>From cff2aa26f93a2558fa92f21e27d3c088d9059fd9 Mon Sep 17 00:00:00 2001 >From: Alex Arnaud <alex.arnaud@biblibre.com> >Date: Wed, 22 Mar 2017 12:55:49 +0000 >Subject: [PATCH] Bug 12063 - Fix unit tests > >--- > t/db_dependent/Holds/CancelReserves.t | 2 +- > t/db_dependent/Holds/WaitingReserves.t | 20 +++++++++++++++++--- > 2 files changed, 18 insertions(+), 4 deletions(-) > >diff --git a/t/db_dependent/Holds/CancelReserves.t b/t/db_dependent/Holds/CancelReserves.t >index deee1a9..b6d216f 100644 >--- a/t/db_dependent/Holds/CancelReserves.t >+++ b/t/db_dependent/Holds/CancelReserves.t >@@ -78,7 +78,7 @@ my $reserve3 = $builder->build({ > }, > }); > >-Koha::Cache->get_instance()->flush_all(); >+Koha::Caches->get_instance()->flush_all(); > my $holiday = $builder->build({ > source => 'SpecialHoliday', > value => { >diff --git a/t/db_dependent/Holds/WaitingReserves.t b/t/db_dependent/Holds/WaitingReserves.t >index ccd677c..3e2dbcb 100644 >--- a/t/db_dependent/Holds/WaitingReserves.t >+++ b/t/db_dependent/Holds/WaitingReserves.t >@@ -19,6 +19,8 @@ my $dbh = C4::Context->dbh; > $dbh->{AutoCommit} = 0; > $dbh->{RaiseError} = 1; > $dbh->do(q{DELETE FROM special_holidays}); >+$dbh->do(q{DELETE FROM repeatable_holidays}); >+$dbh->do("DELETE FROM reserves"); > > my $builder = t::lib::TestBuilder->new(); > >@@ -111,6 +113,16 @@ my $item4 = $builder->build({ > }, > }); > >+my $letter = $builder->build({ >+ source => 'Letter', >+ value => { >+ module => 'reserves', >+ code => 'HOLD', >+ message_transport_type => 'print', >+ branchcode => '', >+ }, >+}); >+ > my $today = dt_from_string(); > > my $reserve1_reservedate = $today->clone; >@@ -135,7 +147,7 @@ my $reserve1 = $builder->build({ > t::lib::Mocks::mock_preference('ExpireReservesMaxPickUpDelay', 1); > t::lib::Mocks::mock_preference('ReservesMaxPickUpDelay', 6); > >-ModReserveAffect( $item1->{itemnumber}, $patron1->{borrowernumber}, 0); >+ModReserveAffect( $item1->{itemnumber}, $patron1->{borrowernumber}); > my $r = Koha::Holds->find($reserve1->{reserve_id}); > > is($r->waitingdate, $today->ymd, 'Waiting date should be set to today' ); >@@ -157,7 +169,7 @@ my $reserve2 = $builder->build({ > }, > }); > >-ModReserveAffect( $item2->{itemnumber}, $patron2->{borrowernumber}, 1); >+ModReserveAffect( $item2->{itemnumber}, $patron2->{borrowernumber}); > my $r2 = Koha::Holds->find($reserve2->{reserve_id}); > > is($r2->found, 'T', '2nd reserve - Reserve status is now "To transfer"' ); >@@ -207,8 +219,10 @@ my $holiday2 = $builder->build({ > }, > }); > >+Koha::Caches->get_instance->flush_all; >+ > t::lib::Mocks::mock_preference('ExcludeHolidaysFromMaxPickUpDelay', 1); >-ModReserveAffect( $item3->{itemnumber}, $patron2->{borrowernumber}, 0); >+ModReserveAffect( $item3->{itemnumber}, $patron2->{borrowernumber}); > > # Add 6 days of pickup delay + 1 day of holiday. > my $expected_expiration = $today->clone; >-- >2.7.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 12063
:
26966
|
52558
|
52949
|
52950
|
53100
|
53101
|
59161
|
59162
|
59163
|
59165
|
61401
|
61440
|
61461
|
61735
|
62001
|
62002
|
62003
|
62004
|
62005
|
62474
|
63057
|
63091
|
63092
|
63093
|
63094
|
63095
|
63096
|
63097
|
63098
|
63099