Bugzilla – Attachment 152347 Details for
Bug 33500
Failing test for t/db_dependent/Circulation.t when RecordLocalUseOnReturn is set to record
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 33500: Account for RecordLocalUseOnReturn
Bug-33500-Account-for-RecordLocalUseOnReturn.patch (text/plain), 3.13 KB, created by
Sam Lau
on 2023-06-14 16:04:15 UTC
(
hide
)
Description:
Bug 33500: Account for RecordLocalUseOnReturn
Filename:
MIME Type:
Creator:
Sam Lau
Created:
2023-06-14 16:04:15 UTC
Size:
3.13 KB
patch
obsolete
>From 9c64cf0bea2a90097e8e3fc1229536b44ad30f4c Mon Sep 17 00:00:00 2001 >From: Lucas Gass <lucas@bywatersolutions.com> >Date: Wed, 14 Jun 2023 15:58:04 +0000 >Subject: [PATCH] Bug 33500: Account for RecordLocalUseOnReturn > >To test: >1. Turn on RecordLocalUseOnReturn >2. prove -v /kohadevbox/koha/t/db_dependent/Circulation.t >3. Tests fail. >4. Apply patch >5. prove -v /kohadevbox/koha/t/db_dependent/Circulation.t >6. Tests pass. > >Signed-off-by: Sam Lau <samalau@gmail.com> >--- > C4/Circulation.pm | 2 ++ > t/db_dependent/Circulation.t | 6 ++++-- > 2 files changed, 6 insertions(+), 2 deletions(-) > >diff --git a/C4/Circulation.pm b/C4/Circulation.pm >index 4fdc525330..3fbae5a058 100644 >--- a/C4/Circulation.pm >+++ b/C4/Circulation.pm >@@ -2114,6 +2114,8 @@ sub AddReturn { > if (C4::Context->preference("RecordLocalUseOnReturn")) { > $messages->{'LocalUse'} = 1; > $stat_type = 'localuse'; >+ } else { >+ $messages->{'LocalUse'} = 0; > } > } > >diff --git a/t/db_dependent/Circulation.t b/t/db_dependent/Circulation.t >index 3cd4ded868..4896d7be0b 100755 >--- a/t/db_dependent/Circulation.t >+++ b/t/db_dependent/Circulation.t >@@ -5803,12 +5803,13 @@ subtest 'Tests for BlockReturnOfWithdrawnItems' => sub { > plan tests => 1; > > t::lib::Mocks::mock_preference('BlockReturnOfWithdrawnItems', 1); >+ my $RecordLocalUseOnReturn = C4::Context->preference('RecordLocalUseOnReturn') ? 1 : 0; > my $item = $builder->build_sample_item(); > $item->withdrawn(1)->itemlost(1)->store; > my @return = AddReturn( $item->barcode, $item->homebranch, 0, undef ); > is_deeply( > \@return, >- [ 0, { NotIssued => $item->barcode, withdrawn => 1 }, undef, {} ], "Item returned as withdrawn, no other messages"); >+ [ 0, { NotIssued => $item->barcode, withdrawn => 1, LocalUse => $RecordLocalUseOnReturn }, undef, {} ], "Item returned as withdrawn, no other messages"); > }; > > subtest 'Tests for transfer not in transit' => sub { >@@ -5819,6 +5820,7 @@ subtest 'Tests for transfer not in transit' => sub { > # These tests are to ensure a 'pending' transfer, generated by > # stock rotation, will be advanced when checked in > >+ my $RecordLocalUseOnReturn = C4::Context->preference('RecordLocalUseOnReturn') ? 1 : 0; > my $item = $builder->build_sample_item(); > my $transfer = $builder->build_object({ class => 'Koha::Item::Transfers', value => { > itemnumber => $item->id, >@@ -5829,7 +5831,7 @@ subtest 'Tests for transfer not in transit' => sub { > my @return = AddReturn( $item->barcode, $item->homebranch, 0, undef ); > is_deeply( > \@return, >- [ 0, { WasTransfered => $transfer->tobranch, TransferTrigger => 'StockrotationRepatriation', NotIssued => $item->barcode }, undef, {} ], "Item is reported to have been transferred"); >+ [ 0, { WasTransfered => $transfer->tobranch, TransferTrigger => 'StockrotationRepatriation', NotIssued => $item->barcode, LocalUse => $RecordLocalUseOnReturn }, undef, {} ], "Item is reported to have been transferred"); > > $transfer->discard_changes; > ok( $transfer->datesent, 'The datesent field is populated, i.e. transfer is initiated'); >-- >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 33500
:
152346
|
152347
|
152352
|
152355
|
152623