Bugzilla – Attachment 159511 Details for
Bug 35322
AllowItemsOnHoldCheckoutSCO and AllowItemsOnHoldCheckoutSIP do not work
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 35322: Add unit tests
Bug-35322-Add-unit-tests.patch (text/plain), 3.37 KB, created by
David Nind
on 2023-12-04 01:42:31 UTC
(
hide
)
Description:
Bug 35322: Add unit tests
Filename:
MIME Type:
Creator:
David Nind
Created:
2023-12-04 01:42:31 UTC
Size:
3.37 KB
patch
obsolete
>From 9bd5c66d52a86c6dc462570601035659d0cd1545 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Wed, 29 Nov 2023 09:33:55 -0500 >Subject: [PATCH] Bug 35322: Add unit tests > >Signed-off-by: David Nind <david@davidnind.com> >--- > t/db_dependent/Circulation.t | 61 +++++++++++++++++++++++++++++++++++- > 1 file changed, 60 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Circulation.t b/t/db_dependent/Circulation.t >index 288c565013..f0c0e2ede9 100755 >--- a/t/db_dependent/Circulation.t >+++ b/t/db_dependent/Circulation.t >@@ -18,7 +18,7 @@ > use Modern::Perl; > use utf8; > >-use Test::More tests => 67; >+use Test::More tests => 68; > use Test::Exception; > use Test::MockModule; > use Test::Deep qw( cmp_deeply ); >@@ -6133,6 +6133,65 @@ subtest 'Tests for RecordLocalUseOnReturn' => sub { > [ 0, { NotIssued => $item->barcode, withdrawn => 1, LocalUse => 1 }, undef, {} ], "Local use is recorded"); > }; > >+subtest 'Test CanBookBeIssued param ignore_reserves (Bug 35322)' => sub { >+ plan tests => 4; >+ >+ my $homebranch = $builder->build( { source => 'Branch' } ); >+ my $holdingbranch = $builder->build( { source => 'Branch' } ); >+ my $patron_1 = $builder->build_object( { class => 'Koha::Patrons', value => { categorycode => $patron_category->{categorycode} } } ); >+ my $patron_2 = $builder->build_object( { class => 'Koha::Patrons', value => { categorycode => $patron_category->{categorycode} } } ); >+ >+ my $item = $builder->build_sample_item( >+ { >+ homebranch => $homebranch->{branchcode}, >+ holdingbranch => $holdingbranch->{branchcode}, >+ } >+ ); >+ >+ Koha::CirculationRules->search()->delete(); >+ Koha::CirculationRules->set_rules( >+ { >+ categorycode => undef, >+ itemtype => undef, >+ branchcode => undef, >+ rules => { >+ reservesallowed => 25, >+ issuelength => 14, >+ lengthunit => 'days', >+ renewalsallowed => 1, >+ renewalperiod => 7, >+ chargeperiod => 1, >+ maxissueqty => 20, >+ } >+ } >+ ); >+ >+ my $reserve_id = AddReserve( >+ { >+ branchcode => $homebranch, >+ borrowernumber => $patron_1->id, >+ biblionumber => $item->biblionumber, >+ priority => 1, >+ reservation_date => dt_from_string, >+ expiration_date => dt_from_string, >+ itemnumber => $item->id, >+ found => 'W', >+ } >+ ); >+ >+ set_userenv($holdingbranch); >+ >+ my ( $error, $question, $alerts ) = CanBookBeIssued( $patron_2, $item->barcode, undef, undef, 0 ); >+ is( keys(%$error) + keys(%$alerts), 0, 'There should not be any errors or alerts (impossible)' . str($error, $question, $alerts) ); >+ is( exists $question->{RESERVE_WAITING}, 1, 'RESERVE_WAITING is set' ); >+ >+ ( $error, $question, $alerts ) = CanBookBeIssued( $patron_2, $item->barcode, undef, undef, 1 ); >+ is( keys(%$error) + keys(%$alerts), 0, 'There should not be any errors or alerts (impossible)' . str($error, $question, $alerts) ); >+ isnt( exists $question->{RESERVE_WAITING}, 1, 'RESERVE_WAITING is not set' ); >+ >+}; >+ >+ > $schema->storage->txn_rollback; > C4::Context->clear_syspref_cache(); > $branches = Koha::Libraries->search(); >-- >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 35322
:
158886
|
159341
|
159510
|
159511
|
160892
|
160893
|
160894