Bugzilla – Attachment 151413 Details for
Bug 33761
Holds queue is not selecting items with completed transfers
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 33761: Unit test
Bug-33761-Unit-test.patch (text/plain), 2.14 KB, created by
Martin Renvoize (ashimema)
on 2023-05-18 12:56:35 UTC
(
hide
)
Description:
Bug 33761: Unit test
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2023-05-18 12:56:35 UTC
Size:
2.14 KB
patch
obsolete
>From b7ad8d86c6eeb1c20466be89797c5a537a65f724 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Mon, 15 Aug 2022 13:34:02 +0000 >Subject: [PATCH] Bug 33761: Unit test > >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > t/db_dependent/HoldsQueue.t | 33 ++++++++++++++++++++++++++++++++- > 1 file changed, 32 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/HoldsQueue.t b/t/db_dependent/HoldsQueue.t >index a851cf32be..7eb78ce2bd 100755 >--- a/t/db_dependent/HoldsQueue.t >+++ b/t/db_dependent/HoldsQueue.t >@@ -8,7 +8,7 @@ > > use Modern::Perl; > >-use Test::More tests => 60; >+use Test::More tests => 61; > use Data::Dumper; > > use C4::Calendar qw( new insert_single_holiday ); >@@ -2060,3 +2060,34 @@ subtest "Test HoldsQueuePrioritizeBranch" => sub { > > $schema->storage->txn_rollback; > }; >+ >+subtest "GetItemsAvailableToFillHoldsRequestsForBib" => sub { >+ plan tests => 2; >+ >+ $schema->storage->txn_begin; >+ >+ my $item_1 = $builder->build_sample_item(); >+ my $item_2 = $builder->build_sample_item({ biblionumber => $item_1->biblionumber }); >+ my $item_3 = $builder->build_sample_item({ biblionumber => $item_1->biblionumber }); >+ >+ my $transfer_1 = $builder->build_object({ class => 'Koha::Item::Transfers', value => { >+ itemnumber => $item_1->itemnumber, >+ datearrived => undef, >+ datecancelled => undef >+ }}); >+ my $transfer_2 = $builder->build_object({ class => 'Koha::Item::Transfers', value => { >+ itemnumber => $item_2->itemnumber, >+ datearrived => dt_from_string, >+ datecancelled => undef >+ }}); >+ my $transfer_3 = $builder->build_object({ class => 'Koha::Item::Transfers', value => { >+ itemnumber => $item_3->itemnumber, >+ datearrived => undef, >+ datecancelled => dt_from_string >+ }}); >+ >+ my $items = C4::HoldsQueue::GetItemsAvailableToFillHoldRequestsForBib( $item_1->biblionumber ); >+ is( scalar @$items, 2, "Two items without active transfers correctly retrieved"); >+ is_deeply( [$items->[0]->{itemnumber},$items->[1]->{itemnumber}],[$item_2->itemnumber,$item_3->itemnumber],"Correct two items retrieved"); >+ >+}; >-- >2.40.1
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 33761
:
151386
|
151387
| 151413 |
151414