Bugzilla – Attachment 106535 Details for
Bug 25408
CanBookBeReserved & CanItemBeReserved should check "opacitemholds" policy
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 25408: Added unit tests for opacitemholds policy
Bug-25408-Added-unit-tests-for-opacitemholds-polic.patch (text/plain), 3.75 KB, created by
Victor Grousset/tuxayo
on 2020-07-05 02:53:15 UTC
(
hide
)
Description:
Bug 25408: Added unit tests for opacitemholds policy
Filename:
MIME Type:
Creator:
Victor Grousset/tuxayo
Created:
2020-07-05 02:53:15 UTC
Size:
3.75 KB
patch
obsolete
>From 517fc30d580878845c347e8c27a1b533564ec408 Mon Sep 17 00:00:00 2001 >From: Arthur Suzuki <arthur.suzuki@biblibre.com> >Date: Wed, 17 Jun 2020 23:36:27 +0200 >Subject: [PATCH] Bug 25408: Added unit tests for opacitemholds policy > >Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net> >--- > t/db_dependent/Reserves.t | 90 ++++++++++++++++++++++++++++++++++++++- > 1 file changed, 89 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Reserves.t b/t/db_dependent/Reserves.t >index e9f1de6f86..84c02599a0 100755 >--- a/t/db_dependent/Reserves.t >+++ b/t/db_dependent/Reserves.t >@@ -921,7 +921,7 @@ subtest 'ChargeReserveFee tests' => sub { > }; > > subtest 'reserves.item_level_hold' => sub { >- plan tests => 2; >+ plan tests => 3; > > my $item = $builder->build_sample_item; > my $patron = $builder->build_object( >@@ -989,6 +989,94 @@ subtest 'reserves.item_level_hold' => sub { > $hold->delete; > }; > >+ subtest 'test opacitemholds rules' => sub { >+ plan tests => 6; >+ >+ Koha::CirculationRules->set_rules( >+ { >+ branchcode => undef, >+ categorycode => undef, >+ itemtype => undef, >+ rules => { >+ reservesallowed => 25, >+ opacitemholds => 'F', >+ } >+ } >+ ); >+ >+ my $canreserve = C4::Reserves::CanBookBeReserved( >+ $patron->borrowernumber, >+ $item->biblionumber, >+ ); >+ >+ is( $canreserve->{status}, >+ 'RecordHoldNotAllowed', >+ 'record-level holds should not be possible with opacitemholds set to "Force"' ); >+ >+ $canreserve = C4::Reserves::CanItemBeReserved( >+ $patron->borrowernumber, >+ $item->itemnumber, >+ ); >+ >+ is( $canreserve->{status}, 'OK', >+ 'item-level holds should be possible with opacitemholds set to "Force"' ); >+ >+ Koha::CirculationRules->set_rules( >+ { >+ branchcode => undef, >+ categorycode => undef, >+ itemtype => undef, >+ rules => { >+ reservesallowed => 25, >+ opacitemholds => 'N', >+ } >+ } >+ ); >+ >+ $canreserve = C4::Reserves::CanBookBeReserved( >+ $patron->borrowernumber, >+ $item->biblionumber, >+ ); >+ >+ is( $canreserve->{status}, 'OK', >+ 'record-level holds should be possible with opacitemholds set to "No"' ); >+ >+ $canreserve = C4::Reserves::CanItemBeReserved( >+ $patron->borrowernumber, >+ $item->itemnumber, >+ ); >+ >+ is( $canreserve->{status}, 'notReservable', >+ 'item-level holds should not be possible with opacitemholds set to "No"' ); >+ >+ Koha::CirculationRules->set_rules( >+ { >+ branchcode => undef, >+ categorycode => undef, >+ itemtype => undef, >+ rules => { >+ reservesallowed => 25, >+ opacitemholds => 'Y', >+ } >+ } >+ ); >+ >+ $canreserve = C4::Reserves::CanBookBeReserved( >+ $patron->borrowernumber, >+ $item->biblionumber, >+ ); >+ >+ is( $canreserve->{status}, 'OK', >+ 'record-level holds should be possible with opacitemholds set to "Yes"' ); >+ >+ $canreserve = C4::Reserves::CanItemBeReserved( >+ $patron->borrowernumber, >+ $item->itemnumber, >+ ); >+ >+ is( $canreserve->{status}, 'OK', >+ 'item-level holds should be possible with opacitemholds set to "Yes"' ); >+ }; > }; > > subtest 'MoveReserve additional test' => sub { >-- >2.27.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 25408
:
104488
|
104496
|
105988
|
105989
|
105990
|
106413
|
106414
|
106521
|
106535
|
106536
|
106537
|
107777
|
107778
|
107779
|
107780
|
111681
|
111682
|
111693
|
111696
|
111716
|
111717
|
111718
|
111719
|
111720
|
111721
|
115125
|
115126
|
115127
|
115128
|
115129
|
115130
|
121524
|
121525
|
121526
|
121527
|
121528
|
121530
|
128505
|
130180
|
130181
|
132658
|
132660
|
132661
|
164680
|
164681
|
164682
|
164684
|
164685
|
164686
|
164693
|
164694
|
164878
|
164879
|
165111
|
165112
|
165442
|
165443
|
165444
|
165445