Bugzilla – Attachment 120332 Details for
Bug 28206
Waiting holds should be filled at checkout even if they violate holds policies
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 28206: Add tests
Bug-28206-Add-tests.patch (text/plain), 2.17 KB, created by
Jonathan Druart
on 2021-04-30 09:46:40 UTC
(
hide
)
Description:
Bug 28206: Add tests
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2021-04-30 09:46:40 UTC
Size:
2.17 KB
patch
obsolete
>From fdd634989b68b374434e11f681a06b90fe74723a Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Fri, 30 Apr 2021 11:45:59 +0200 >Subject: [PATCH] Bug 28206: Add tests > >--- > t/db_dependent/Holds.t | 23 ++++++++++++++++++++--- > 1 file changed, 20 insertions(+), 3 deletions(-) > >diff --git a/t/db_dependent/Holds.t b/t/db_dependent/Holds.t >index a17a173c95b..3a441e571bd 100755 >--- a/t/db_dependent/Holds.t >+++ b/t/db_dependent/Holds.t >@@ -326,7 +326,7 @@ ok( > } > > subtest 'AllowHoldsOnDamagedItems' => sub { >- plan tests => 5; >+ plan tests => 7; > > my $library = $builder->build_object( { class => 'Koha::Libraries' } ); > my $biblio = $builder->build_sample_biblio; >@@ -340,13 +340,14 @@ subtest 'AllowHoldsOnDamagedItems' => sub { > } > ); > >- my $itemnumber = $builder->build_sample_item( >+ my $item = $builder->build_sample_item( > { > library => $library->branchcode, > biblionumber => $biblio->biblionumber, > damaged => 1 > } >- )->itemnumber; >+ ); >+ my $itemnumber = $item->itemnumber; > t::lib::Mocks::mock_preference( 'AllowHoldsOnDamagedItems', 1 ); > is( > CanItemBeReserved( $patron->borrowernumber, $itemnumber )->{status}, >@@ -381,6 +382,22 @@ subtest 'AllowHoldsOnDamagedItems' => sub { > !defined( ( CheckReserves($itemnumber) )[1] ), "Hold cannot be trapped for damaged item with AllowHoldsOnDamagedItems disabled" > ); > >+ >+ >+ t::lib::Mocks::mock_preference( 'AllowHoldsOnDamagedItems', 0 ); >+ $hold = Koha::Hold->new( >+ { >+ borrowernumber => $patron->borrowernumber, >+ itemnumber => $itemnumber, >+ biblionumber => $biblio->biblionumber, >+ } >+ )->store(); >+ >+ t::lib::Mocks::mock_userenv({ branchcode => $library->branchcode }); >+ my $checkout = AddIssue( $patron->unblessed, $item->barcode ); >+ ok( $checkout, 'AddIssue should have checkout the item' ); >+ is( Koha::Holds->find($hold->reserve_id), undef, 'AddIssue should have filled the hold' ); >+ > }; > > # Items that are not for loan, but holdable should not be trapped until they are available for loan >-- >2.20.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 28206
:
120331
| 120332