Bugzilla – Attachment 91313 Details for
Bug 21181
Cancel expired holds cronjob does not cancel holds in transit if ExpireReservesMaxPickUpDelay not set
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 21181: Unit tests
Bug-21181-Unit-tests.patch (text/plain), 2.41 KB, created by
Marcel de Rooy
on 2019-07-05 06:34:23 UTC
(
hide
)
Description:
Bug 21181: Unit tests
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2019-07-05 06:34:23 UTC
Size:
2.41 KB
patch
obsolete
>From aefe2cdea0e7e10859527ca96f7505aa5ce05e2a Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Wed, 24 Apr 2019 01:21:56 +0000 >Subject: [PATCH] Bug 21181: Unit tests >Content-Type: text/plain; charset=utf-8 > >Signed-off-by: Claire Gravely <claire.gravely@bsz-bw.de> > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > t/db_dependent/Reserves/CancelExpiredReserves.t | 40 ++++++++++++++++++++++++- > 1 file changed, 39 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Reserves/CancelExpiredReserves.t b/t/db_dependent/Reserves/CancelExpiredReserves.t >index 5efd02dd35..e8f8df8cef 100644 >--- a/t/db_dependent/Reserves/CancelExpiredReserves.t >+++ b/t/db_dependent/Reserves/CancelExpiredReserves.t >@@ -1,7 +1,7 @@ > #!/usr/bin/perl > > use Modern::Perl; >-use Test::More tests => 2; >+use Test::More tests => 3; > > use t::lib::Mocks; > use t::lib::TestBuilder; >@@ -161,6 +161,44 @@ subtest 'Test handling of waiting reserves by CancelExpiredReserves' => sub { > CancelExpiredReserves(); > my $count2 = Koha::Holds->search->count; > is( $count2, 1, 'Also the waiting expired hold should be cancelled now'); >+ >+}; >+ >+subtest 'Test handling of in transit reserves by CancelExpiredReserves' => sub { >+ plan tests => 2; >+ >+ my $builder = t::lib::TestBuilder->new(); >+ >+ t::lib::Mocks::mock_preference( 'ExpireReservesMaxPickUpDelay', 1 ); >+ my $expdate = dt_from_string->add( days => -2 ); >+ my $reserve = $builder->build({ >+ source => 'Reserve', >+ value => { >+ expirationdate => '2018-01-01', >+ found => 'T', >+ cancellationdate => undef, >+ suspend => 0, >+ suspend_until => undef >+ } >+ }); >+ my $count = Koha::Holds->search->count; >+ CancelExpiredReserves(); >+ is(Koha::Holds->search->count, $count-1, "Transit hold is cancelled if ExpireReservesMaxPickUpDelay set"); >+ >+ t::lib::Mocks::mock_preference( 'ExpireReservesMaxPickUpDelay', 0 ); >+ my $reserve2 = $builder->build({ >+ source => 'Reserve', >+ value => { >+ expirationdate => '2018-01-01', >+ found => 'T', >+ cancellationdate => undef, >+ suspend => 0, >+ suspend_until => undef >+ } >+ }); >+ CancelExpiredReserves(); >+ is(Koha::Holds->search->count, $count-1, "Transit hold is cancelled if ExpireReservesMaxPickUpDelay unset"); >+ > }; > > $schema->storage->txn_rollback; >-- >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 21181
:
77582
|
81049
|
88583
|
88584
|
90489
|
90490
| 91313 |
91314