Bugzilla – Attachment 170157 Details for
Bug 32702
Item statuses that block holds should be checked in CanItemBeReserved
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 32702: Unit tests
Bug-32702-Unit-tests.patch (text/plain), 2.64 KB, created by
Nick Clemens (kidclamp)
on 2024-08-08 11:22:55 UTC
(
hide
)
Description:
Bug 32702: Unit tests
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2024-08-08 11:22:55 UTC
Size:
2.64 KB
patch
obsolete
>From c0d61a340262674f45812e835391d8699ce6f005 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Mon, 17 Apr 2023 17:08:35 +0000 >Subject: [PATCH] Bug 32702: Unit tests > >Signed-off-by: Andrew Fuerste Henry <andrewfh@dubcolib.org> >--- > t/db_dependent/Holds.t | 50 +++++++++++++++++++++++++++++++++++++++++- > 1 file changed, 49 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Holds.t b/t/db_dependent/Holds.t >index 4c78b4c480b..57f32e51f19 100755 >--- a/t/db_dependent/Holds.t >+++ b/t/db_dependent/Holds.t >@@ -418,7 +418,7 @@ is( > ); > > subtest 'CanItemBeReserved' => sub { >- plan tests => 2; >+ plan tests => 3; > > my $itemtype_can = $builder->build({source => "Itemtype"})->{itemtype}; > my $itemtype_cant = $builder->build({source => "Itemtype"})->{itemtype}; >@@ -627,6 +627,54 @@ subtest 'CanItemBeReserved' => sub { > "This patron has already placed reservesallowed holds, tooManyReserves should be raised" > ); > }; >+ >+ subtest 'item status tests' => sub { >+ plan tests => 6; >+ >+ t::lib::Mocks::mock_preference( 'item-level_itypes', 1 ); >+ my $item = $builder->build_sample_item(); >+ my $biblioitem = $item->biblio->biblioitem; >+ $biblioitem->itemtype(undef)->store(); >+ $item->update( { itype => undef } ); >+ is( >+ CanItemBeReserved( $patrons[0], $item )->{status}, 'missing_itemtype', >+ "Item with no itemtype cannot be reserved" >+ ); >+ >+ my $itemtype = $builder->build_object( { class => 'Koha::ItemTypes', value => { notforloan => 1 } } ); >+ $item->itype( $itemtype->id )->store(); >+ >+ is( >+ CanItemBeReserved( $patrons[0], $item )->{status}, 'notforloan', >+ "Item with no notforloan itemtype cannot be reserved" >+ ); >+ >+ $itemtype->notforloan(0)->store(); >+ $item->notforloan(1)->store(); >+ >+ is( >+ CanItemBeReserved( $patrons[0], $item )->{status}, 'notforloan', >+ "Item with no notforloan status cannot be reserved" >+ ); >+ >+ $item->notforloan(-1)->store(); >+ >+ is( >+ CanItemBeReserved( $patrons[0], $item )->{status}, 'OK', >+ "Item with negative notforloan status can be reserved" >+ ); >+ >+ $item->notforloan(0)->store(); >+ >+ is( CanItemBeReserved( $patrons[0], $item )->{status}, 'OK', "Item with no notforloan status can be reserved" ); >+ >+ $item->withdrawn(1)->store(); >+ >+ is( >+ CanItemBeReserved( $patrons[0], $item )->{status}, 'withdrawn', >+ "Item with withdrawn status cannot be reserved" >+ ); >+ }; > }; > > >-- >2.39.2
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 32702
:
145590
|
149762
|
149763
|
157133
|
157134
|
161725
|
161726
|
170156
| 170157 |
170158