Bugzilla – Attachment 152355 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: Add tests for RecordLocalUseOnReturn
Bug-33500-Add-tests-for-RecordLocalUseOnReturn.patch (text/plain), 2.29 KB, created by
Sam Lau
on 2023-06-14 17:57:13 UTC
(
hide
)
Description:
Bug 33500: Add tests for RecordLocalUseOnReturn
Filename:
MIME Type:
Creator:
Sam Lau
Created:
2023-06-14 17:57:13 UTC
Size:
2.29 KB
patch
obsolete
>From c788719f7a58c40796820d84624dcca16aa1845e Mon Sep 17 00:00:00 2001 >From: Lucas Gass <lucas@bywatersolutions.com> >Date: Wed, 14 Jun 2023 17:15:23 +0000 >Subject: [PATCH] Bug 33500: Add tests 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> >--- > t/db_dependent/Circulation.t | 22 +++++++++++++++++++++- > 1 file changed, 21 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Circulation.t b/t/db_dependent/Circulation.t >index 3cd4ded868..5c91fb195b 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 => 66; >+use Test::More tests => 67; > use Test::Exception; > use Test::MockModule; > use Test::Deep qw( cmp_deeply ); >@@ -5803,6 +5803,7 @@ subtest 'Tests for BlockReturnOfWithdrawnItems' => sub { > plan tests => 1; > > t::lib::Mocks::mock_preference('BlockReturnOfWithdrawnItems', 1); >+ t::lib::Mocks::mock_preference('RecordLocalUseOnReturn', 0); > my $item = $builder->build_sample_item(); > $item->withdrawn(1)->itemlost(1)->store; > my @return = AddReturn( $item->barcode, $item->homebranch, 0, undef ); >@@ -5836,6 +5837,25 @@ subtest 'Tests for transfer not in transit' => sub { > > }; > >+subtest 'Tests for RecordLocalUseOnReturn' => sub { >+ >+ plan tests => 2; >+ >+ t::lib::Mocks::mock_preference('RecordLocalUseOnReturn', 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, {} ], "RecordLocalUSeOnReturn is off, no local use recorded"); >+ >+ t::lib::Mocks::mock_preference('RecordLocalUseOnReturn', 1); >+ my @return2 = AddReturn( $item->barcode, $item->homebranch, 0, undef ); >+ is_deeply( >+ \@return2, >+ [ 0, { NotIssued => $item->barcode, withdrawn => 1, LocalUse => 1 }, undef, {} ], "Local use is recorded"); >+}; >+ > $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 33500
:
152346
|
152347
|
152352
|
152355
|
152623