Bugzilla – Attachment 160514 Details for
Bug 35100
Items assigned to StockRotation do not advance if a hold is triggered before the initial transfer
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 35100: Unit tests
Bug-35100-Unit-tests.patch (text/plain), 2.15 KB, created by
Martin Renvoize (ashimema)
on 2024-01-04 12:20:09 UTC
(
hide
)
Description:
Bug 35100: Unit tests
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2024-01-04 12:20:09 UTC
Size:
2.15 KB
patch
obsolete
>From bf1df32ebc08522ddee19903b4acc14a7b26ae6f Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Thu, 4 Jan 2024 12:09:47 +0000 >Subject: [PATCH] Bug 35100: Unit tests > >This patch adds a unit test to ensure StockrotationAdvance transfers are >not cancelled from request_transfer when called with 'replace'. >--- > t/db_dependent/Koha/Item.t | 20 +++++++++++++++++++- > 1 file changed, 19 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Koha/Item.t b/t/db_dependent/Koha/Item.t >index 7a21db18f55..05d19ad1165 100755 >--- a/t/db_dependent/Koha/Item.t >+++ b/t/db_dependent/Koha/Item.t >@@ -757,7 +757,7 @@ subtest 'pickup_locations() tests' => sub { > }; > > subtest 'request_transfer' => sub { >- plan tests => 13; >+ plan tests => 17; > $schema->storage->txn_begin; > > my $library1 = $builder->build_object( { class => 'Koha::Libraries' } ); >@@ -817,6 +817,24 @@ subtest 'request_transfer' => sub { > is($transfers->count, 1, "There is only 1 live transfer in the queue"); > $replaced_transfer->datearrived(dt_from_string)->store(); > >+ # Replace StockrotationAdvance transfer >+ my $stock_transfer = $item->request_transfer( { to => $library1, reason => 'StockrotationAdvance' } ); >+ is( >+ ref($stock_transfer), 'Koha::Item::Transfer', >+ 'Koha::Item->request_transfer added StockrotationAdvance transfer' >+ ); >+ $replaced_transfer = $item->request_transfer( { to => $library2, reason => 'Manual', replace => 1 } ); >+ is( >+ ref($replaced_transfer), 'Koha::Item::Transfer', >+ 'Koha::Item->request_transfer allowed when replace is set' >+ ); >+ $stock_transfer->discard_changes; >+ is( $stock_transfer->datecancelled, undef, "StockrotationAdvance transfer left intact" ); >+ $transfers = $item->get_transfers; >+ is( $transfers->count, 2, "There are now 2 live transfers in the queue" ); >+ $replaced_transfer->datearrived(dt_from_string)->store(); >+ $stock_transfer->datearrived(dt_from_string)->store(); >+ > # BranchTransferLimits > t::lib::Mocks::mock_preference('UseBranchTransferLimits', 1); > t::lib::Mocks::mock_preference('BranchTransferLimitsType', 'itemtype'); >-- >2.43.0
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 35100
:
160514
|
160515
|
160557
|
160558
|
160575
|
160623
|
160628
|
160641
|
160642
|
160643
|
160647
|
160648
|
160687
|
160688
|
160689
|
160690
|
162740
|
162741
|
162742
|
162743
|
162744
|
162745
|
162746
|
162747
|
162757
|
162758
|
162759
|
162760
|
162761
|
162762
|
165096
|
165097
|
165098
|
165099
|
165100
|
165101
|
168273
|
168274
|
168275
|
168276
|
168277
|
168278
|
169347
|
169348
|
169349
|
169350
|
169351
|
169352
|
169353
|
171530
|
171531
|
171532
|
171533
|
171534
|
171535
|
171559
|
171560
|
171561
|
171562
|
171563
|
171564