Bugzilla – Attachment 129061 Details for
Bug 29808
Stock rotation fails to advance when an item is checked out from the branch that is the next stage
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 29808: Unit tests
Bug-29808-Unit-tests.patch (text/plain), 2.15 KB, created by
Nick Clemens (kidclamp)
on 2022-01-06 12:43:31 UTC
(
hide
)
Description:
Bug 29808: Unit tests
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2022-01-06 12:43:31 UTC
Size:
2.15 KB
patch
obsolete
>From cca8a0969c9e0f059d30c2d2da9e59c092b85190 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Thu, 6 Jan 2022 12:28:23 +0000 >Subject: [PATCH] Bug 29808: Unit tests > >--- > t/db_dependent/StockRotationItems.t | 26 +++++++++++++++++++++++++- > 1 file changed, 25 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/StockRotationItems.t b/t/db_dependent/StockRotationItems.t >index 715f78a068..03a82381b2 100755 >--- a/t/db_dependent/StockRotationItems.t >+++ b/t/db_dependent/StockRotationItems.t >@@ -273,7 +273,7 @@ subtest "Tests for needs_advancing." => sub { > }; > > subtest "Tests for advance." => sub { >- plan tests => 44; >+ plan tests => 48; > $schema->storage->txn_begin; > > my $sritem_1 = $builder->build_object( >@@ -463,6 +463,30 @@ subtest "Tests for advance." => sub { > $transfer_request->datearrived(dt_from_string())->store; > $sritem_1->itemnumber->holdingbranch($srstage_2->branchcode_id)->store; > >+ # Checked out item, advanced to next stage, checkedout from next stage >+ # transfer should be generated, but not initiated >+ my $issue = $builder->build_object({ >+ class => 'Koha::Checkouts', >+ value => { >+ branchcode => $srstage_1->branchcode_id, >+ itemnumber => $sritem_1->itemnumber->itemnumber, >+ returndate => undef >+ } >+ }); >+ $sritem_1->itemnumber->holdingbranch($srstage_1->branchcode_id)->store; >+ ok($sritem_1->advance, "Advancement done."); >+ $transfer_request = $sritem_1->itemnumber->get_transfer; >+ is($transfer_request->frombranch, $srstage_1->branchcode_id, "Origin correct."); >+ is($transfer_request->tobranch, $srstage_1->branchcode_id, "Target correct."); >+ is($transfer_request->datesent, undef, "Transfer waiting to initiate until return."); >+ >+ $issue->delete; #remove issue >+ $sritem_1->advance; #advance back to second stage >+ # Set arrived >+ $transfer_request->datearrived(dt_from_string())->store; >+ $sritem_1->itemnumber->holdingbranch($srstage_2->branchcode_id)->store; >+ >+ > $srstage_1->rota->cyclical(0)->store; # Set Rota to non-cyclical. > > my $srstage_3 = $builder->build_object({ >-- >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 29808
:
129061
|
129062
|
129082
|
129083