Bugzilla – Attachment 150519 Details for
Bug 33611
Holds being placed in the future if DefaultHoldExpirationdate is set
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 33611: Unit test
Bug-33611-Unit-test.patch (text/plain), 1.76 KB, created by
Jonathan Druart
on 2023-05-02 14:07:58 UTC
(
hide
)
Description:
Bug 33611: Unit test
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2023-05-02 14:07:58 UTC
Size:
1.76 KB
patch
obsolete
>From 6b839f0139efceed019a8e584d6304073354eb91 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Thu, 27 Apr 2023 13:02:24 +0000 >Subject: [PATCH] Bug 33611: Unit test > >Signed-off-by: David Nind <david@davidnind.com> > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >--- > t/db_dependent/Reserves.t | 28 +++++++++++++++++++++++++++- > 1 file changed, 27 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Reserves.t b/t/db_dependent/Reserves.t >index 3371c9539d7..e64393154e7 100755 >--- a/t/db_dependent/Reserves.t >+++ b/t/db_dependent/Reserves.t >@@ -17,7 +17,7 @@ > > use Modern::Perl; > >-use Test::More tests => 77; >+use Test::More tests => 78; > use Test::MockModule; > use Test::Warn; > >@@ -1735,3 +1735,29 @@ subtest 'CanItemBeReserved() tests' => sub { > > $schema->storage->txn_rollback; > }; >+ >+subtest 'DefaultHoldExpiration tests' => sub { >+ plan tests => 2; >+ $schema->storage->txn_begin; >+ >+ t::lib::Mocks::mock_preference( 'DefaultHoldExpirationdate', 1 ); >+ t::lib::Mocks::mock_preference( 'DefaultHoldExpirationdatePeriod', 365 ); >+ t::lib::Mocks::mock_preference( 'DefaultHoldExpirationUnitOfTime', 'days;' ); >+ >+ my $patron = $builder->build_object( { class => 'Koha::Patrons' } ); >+ my $item = $builder->build_sample_item(); >+ >+ my $reserve_id = AddReserve({ >+ branchcode => $item->homebranch, >+ borrowernumber => $patron->id, >+ biblionumber => $item->biblionumber, >+ }); >+ >+ my $today = dt_from_string(); >+ my $hold = Koha::Holds->find( $reserve_id ); >+ >+ is( $hold->reservedate, $today->ymd, "Hold created today" ); >+ is( $hold->expirationdate, $today->add( days => 365)->ymd, "Reserve date set 1 year from today" ); >+ >+ $schema->txn_rollback; >+}; >-- >2.25.1
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 33611
:
150223
|
150294
|
150295
|
150463
|
150464
|
150519
|
150520
|
150797
|
150798