Bugzilla – Attachment 148751 Details for
Bug 29234
Transfers generated by stock rotation alert but do not initiate at checkin
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 29234: Unit test
Bug-29234-Unit-test.patch (text/plain), 2.98 KB, created by
Nick Clemens (kidclamp)
on 2023-03-27 11:08:32 UTC
(
hide
)
Description:
Bug 29234: Unit test
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2023-03-27 11:08:32 UTC
Size:
2.98 KB
patch
obsolete
>From 1dae5b15f9df978ab752c3fb5d98acc1e847eac4 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Mon, 27 Mar 2023 10:58:43 +0000 >Subject: [PATCH] Bug 29234: Unit test > >This patch adds a test that a pending stock rotation transfer is initiated on >checkin, as well as updating the defaults for creating transfer objects > >To test: >prove -v t/db_dependent/Circulation.t >--- > t/db_dependent/Circulation.t | 27 ++++++++++++++++++++++++++- > t/lib/TestBuilder.pm | 12 ++++++++++++ > 2 files changed, 38 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Circulation.t b/t/db_dependent/Circulation.t >index ba4c34f5c4..1bbefe78a4 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 => 65; >+use Test::More tests => 66; > use Test::Exception; > use Test::MockModule; > use Test::Deep qw( cmp_deeply ); >@@ -5818,6 +5818,31 @@ subtest 'Tests for BlockReturnOfWithdrawnItems' => sub { > [ 0, { NotIssued => $item->barcode, withdrawn => 1 }, undef, {} ], "Item returned as withdrawn, no other messages"); > }; > >+subtest 'Tests for transfer not in transit' => sub { >+ >+ plan tests => 2; >+ >+ >+ # These tests are to ensure a 'pending' transfer, generated by >+ # stock rotation, will be advanced when checked in >+ >+ my $item = $builder->build_sample_item(); >+ my $transfer = $builder->build_object({ class => 'Koha::Item::Transfers', value => { >+ itemnumber => $item->id, >+ reason => 'StockrotationRepatriation', >+ datesent => undef, >+ frombranch => $item->homebranch, >+ }}); >+ 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"); >+ >+ $transfer->discard_changes; >+ ok( $transfer->datesent, 'The datesent field is populated, i.e. transfer is initiated'); >+ >+}; >+ > $schema->storage->txn_rollback; > C4::Context->clear_syspref_cache(); > $branches = Koha::Libraries->search(); >diff --git a/t/lib/TestBuilder.pm b/t/lib/TestBuilder.pm >index 8f8d79699a..59137b143e 100644 >--- a/t/lib/TestBuilder.pm >+++ b/t/lib/TestBuilder.pm >@@ -590,6 +590,18 @@ sub _gen_default_values { > materials => undef, > more_subfields_xml => undef, > }, >+ Branchtransfer => { >+ daterequested => dt_from_string(), >+ datesent => dt_from_string(), >+ datearrived => undef, >+ datecancelled => undef, >+ reason => undef, >+ withdrawn => 0, >+ restricted => 0, >+ damaged => 0, >+ materials => undef, >+ more_subfields_xml => undef, >+ }, > Category => { > enrolmentfee => 0, > reservefee => 0, >-- >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 29234
:
126267
|
126269
|
126300
|
126481
| 148751 |
148752
|
149046
|
149093
|
149094
|
149095
|
149096