Bugzilla – Attachment 117198 Details for
Bug 27718
Holds to Pull list doesn't respect holdallowed circulation rule anymore
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 27718: Add tests
Bug-27718-Add-tests.patch (text/plain), 3.13 KB, created by
Jonathan Druart
on 2021-02-23 12:04:10 UTC
(
hide
)
Description:
Bug 27718: Add tests
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2021-02-23 12:04:10 UTC
Size:
3.13 KB
patch
obsolete
>From 3eb0eb054b11530e7ca936de83372011d65ff8ce Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 17 Feb 2021 16:11:19 +0100 >Subject: [PATCH] Bug 27718: Add tests > >--- > t/db_dependent/Koha/Holds.t | 31 +++++++++++++++++++++++-------- > 1 file changed, 23 insertions(+), 8 deletions(-) > >diff --git a/t/db_dependent/Koha/Holds.t b/t/db_dependent/Koha/Holds.t >index 0bce39dc52..948a9311c4 100755 >--- a/t/db_dependent/Koha/Holds.t >+++ b/t/db_dependent/Koha/Holds.t >@@ -410,17 +410,19 @@ subtest 'Desks' => sub { > }; > > subtest 'get_items_that_can_fill' => sub { >- plan tests => 1; >+ plan tests => 2; > > my $biblio = $builder->build_sample_biblio; >- my $item_1 = $builder->build_sample_item( { biblionumber => $biblio->biblionumber } ); >+ my $itype_1 = $builder->build_object({ class => 'Koha::ItemTypes' }); # For 1, 2, 3, 4 >+ my $itype_2 = $builder->build_object({ class => 'Koha::ItemTypes' }); >+ my $item_1 = $builder->build_sample_item( { biblionumber => $biblio->biblionumber, itype => $itype_1->itemtype } ); > # waiting >- my $item_2 = $builder->build_sample_item( { biblionumber => $biblio->biblionumber } ); >- my $item_3 = $builder->build_sample_item( { biblionumber => $biblio->biblionumber } ) >+ my $item_2 = $builder->build_sample_item( { biblionumber => $biblio->biblionumber, itype => $itype_1->itemtype } ); >+ my $item_3 = $builder->build_sample_item( { biblionumber => $biblio->biblionumber, itype => $itype_1->itemtype } ) > ; # onloan >- my $item_4 = $builder->build_sample_item( { biblionumber => $biblio->biblionumber } ) >+ my $item_4 = $builder->build_sample_item( { biblionumber => $biblio->biblionumber, itype => $itype_1->itemtype } ) > ; # in transfer >- my $item_5 = $builder->build_sample_item( { biblionumber => $biblio->biblionumber } ); >+ my $item_5 = $builder->build_sample_item( { biblionumber => $biblio->biblionumber, itype => $itype_2->itemtype } ); > my $lost = $builder->build_sample_item( { biblionumber => $biblio->biblionumber, itemlost => 1 } ); > my $withdrawn = $builder->build_sample_item( { biblionumber => $biblio->biblionumber, withdrawn => 1 } ); > my $notforloan = $builder->build_sample_item( { biblionumber => $biblio->biblionumber, notforloan => 1 } ); >@@ -480,9 +482,22 @@ subtest 'get_items_that_can_fill' => sub { > } > ); > >- my @items = $holds->get_items_that_can_fill; >- is_deeply( [ map { $_->itemnumber } @items ], >+ my $items = $holds->get_items_that_can_fill; >+ is_deeply( [ map { $_->itemnumber } $items->as_list ], > [ $item_2->itemnumber, $item_5->itemnumber ], 'Only item 2 and 5 are available for filling the hold' ); >+ >+ # Marking item_5 is no hold allowed >+ Koha::CirculationRule->new( >+ { >+ rule_name => 'holdallowed', >+ rule_value => 0, >+ itemtype => $item_5->itype >+ } >+ )->store; >+ $items = $holds->get_items_that_can_fill; >+ is_deeply( [ map { $_->itemnumber } $items->as_list ], >+ [ $item_2->itemnumber ], 'Only item 1 is available for filling the hold' ); >+ > }; > > $schema->storage->txn_rollback; >-- >2.20.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 27718
:
116940
|
116941
|
117198
|
117199
|
117234
|
117235
|
117241
|
117242
|
117243
|
117291
|
117292
|
117293