Bugzilla – Attachment 180184 Details for
Bug 35292
Define itemtype specific rules in the UpdateNotForLoanStatusOnCheckOut system preference
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 35292: Move tests of UpdateNotforloan together
Bug-35292-Move-tests-of-UpdateNotforloan-together.patch (text/plain), 4.04 KB, created by
Baptiste Wojtkowski (bwoj)
on 2025-04-01 13:15:49 UTC
(
hide
)
Description:
Bug 35292: Move tests of UpdateNotforloan together
Filename:
MIME Type:
Creator:
Baptiste Wojtkowski (bwoj)
Created:
2025-04-01 13:15:49 UTC
Size:
4.04 KB
patch
obsolete
>From 48b8fc306ade5ac5ba18387efd3a7f7538b54aab Mon Sep 17 00:00:00 2001 >From: Baptiste <baptiste.wojtkowski@biblibre.com> >Date: Mon, 9 Dec 2024 14:35:24 +0100 >Subject: [PATCH] Bug 35292: Move tests of UpdateNotforloan together > >Note: These patches have been split for sake of understandability for >review but they should probably be squashed >--- > t/db_dependent/Circulation/issue.t | 77 ++++++++++++++++-------------- > 1 file changed, 42 insertions(+), 35 deletions(-) > >diff --git a/t/db_dependent/Circulation/issue.t b/t/db_dependent/Circulation/issue.t >index aff60236c25..1b800f68222 100755 >--- a/t/db_dependent/Circulation/issue.t >+++ b/t/db_dependent/Circulation/issue.t >@@ -513,6 +513,48 @@ is( > q{UpdateNotForLoanStatusOnCheckin does not update notforloan value for specific itemtype from 1 with setting "1: ONLYMESSAGE"} > ); > >+############################################## >+# >+# UpdateNotForLoanStatusOnCheckout >+# >+############################################## >+ >+my $itemnumber4 = Koha::Item->new( >+ { >+ biblionumber => $biblionumber, >+ barcode => 'barcode_6', >+ itemcallnumber => 'callnumber6', >+ homebranch => $branchcode_1, >+ holdingbranch => $branchcode_1, >+ notforloan => -1, >+ itype => $itemtype, >+ location => 'loc1' >+ }, >+)->store->itemnumber; >+ >+t::lib::Mocks::mock_preference( 'UpdateNotForLoanStatusOnCheckout', q{} ); >+AddIssue( $patron_2, 'barcode_6', dt_from_string ); >+$item = Koha::Items->find( $itemnumber4 ); >+ok( $item->notforloan eq -1, 'UpdateNotForLoanStatusOnCheckout does not modify value when not enabled' ); >+ >+t::lib::Mocks::mock_preference( 'UpdateNotForLoanStatusOnCheckout', '-1: 0' ); >+AddReturn( 'barcode_6', $branchcode_1 ); >+my $test = AddIssue( $patron_2, 'barcode_6', dt_from_string ); >+$item = Koha::Items->find( $itemnumber4 ); >+ok( $item->notforloan eq 0, q{UpdateNotForLoanStatusOnCheckout updates notforloan value from -1 to 0 with setting "-1: 0"} ); >+ >+AddIssue( $patron_2, 'barcode_6', dt_from_string ); >+AddReturn( 'barcode_6', $branchcode_1 ); >+$item = Koha::Items->find( $itemnumber4 ); >+ok( $item->notforloan eq 0, q{UpdateNotForLoanStatusOnCheckout does not update notforloan value from 0 with setting "-1: 0"} ); >+ >+ >+########################################## >+# >+# END UpdateNotforloanOnCheckout >+# >+########################################## >+ > my $itemnumber2 = Koha::Item->new( > { > biblionumber => $biblionumber, >@@ -695,41 +737,6 @@ AddRenewal( > my ($unseen_reset) = ( C4::Circulation::GetRenewCount( $unseen_patron->borrowernumber, $unseen_item->itemnumber ) )[3]; > is( $unseen_reset, 0, 'seen renewal resets the unseen count' ); > >-my $itemnumber4 = Koha::Item->new( >- { >- biblionumber => $biblionumber, >- barcode => 'barcode_6', >- itemcallnumber => 'callnumber6', >- homebranch => $branchcode_1, >- holdingbranch => $branchcode_1, >- notforloan => -1, >- itype => $itemtype, >- location => 'loc1' >- }, >-)->store->itemnumber; >- >-t::lib::Mocks::mock_preference( 'UpdateNotForLoanStatusOnCheckout', q{} ); >-AddIssue( $patron_2, 'barcode_6', dt_from_string ); >-$item = Koha::Items->find($itemnumber4); >-ok( $item->notforloan eq -1, 'UpdateNotForLoanStatusOnCheckout does not modify value when not enabled' ); >- >-t::lib::Mocks::mock_preference( 'UpdateNotForLoanStatusOnCheckout', '-1: 0' ); >-AddReturn( 'barcode_6', $branchcode_1 ); >-my $test = AddIssue( $patron_2, 'barcode_6', dt_from_string ); >-$item = Koha::Items->find($itemnumber4); >-ok( >- $item->notforloan eq 0, >- q{UpdateNotForLoanStatusOnCheckout updates notforloan value from -1 to 0 with setting "-1: 0"} >-); >- >-AddIssue( $patron_2, 'barcode_6', dt_from_string ); >-AddReturn( 'barcode_6', $branchcode_1 ); >-$item = Koha::Items->find($itemnumber4); >-ok( >- $item->notforloan eq 0, >- q{UpdateNotForLoanStatusOnCheckout does not update notforloan value from 0 with setting "-1: 0"} >-); >- > # Bug 21159 - Update item shelving location on checkout > my $itemnumber5 = Koha::Item->new( > { >-- >2.30.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 35292
:
175201
|
175202
|
175203
|
175316
|
175317
|
175318
|
175319
|
175320
|
175321
|
175322
|
179818
|
179819
|
179820
|
179821
|
179822
|
179823
|
179824
|
180101
|
180102
|
180103
|
180104
|
180105
|
180106
|
180181
|
180182
|
180183
|
180184
|
180185
|
180186
|
180210
|
180212
|
180213
|
180214
|
180215
|
180216
|
180217
|
180218
|
180632
|
180633
|
180634
|
180635
|
180636
|
180637
|
180638
|
180646