Bugzilla – Attachment 93260 Details for
Bug 21985
Test t/db_dependent/Circulation.t fails if SearchEngine is set to elasticsearch
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 21985: Trying to fix the next failure
Bug-21985-Trying-to-fix-the-next-failure.patch (text/plain), 4.49 KB, created by
Nick Clemens
on 2019-09-30 13:55:16 UTC
(
hide
)
Description:
Bug 21985: Trying to fix the next failure
Filename:
MIME Type:
Creator:
Nick Clemens
Created:
2019-09-30 13:55:16 UTC
Size:
4.49 KB
patch
obsolete
>From 3bf3d226f2d8c340eff20bc49f23b0d8bb26b57e Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Thu, 14 Mar 2019 19:19:45 -0300 >Subject: [PATCH] Bug 21985: Trying to fix the next failure > >Signed-off-by: Nick Clemens <nick@bywatersolutions.com> >--- > t/db_dependent/Circulation.t | 35 +++++++++++++++-------------------- > 1 file changed, 15 insertions(+), 20 deletions(-) > >diff --git a/t/db_dependent/Circulation.t b/t/db_dependent/Circulation.t >index fa3568bf56..9ad8c6b2fc 100755 >--- a/t/db_dependent/Circulation.t >+++ b/t/db_dependent/Circulation.t >@@ -2629,48 +2629,43 @@ subtest 'Cancel transfers on lost items' => sub { > my $patron_1 = $builder->build( { source => 'Borrower', value => { branchcode => $library_1->{branchcode}, categorycode => $patron_category->{categorycode} } } ); > my $library_2 = $builder->build( { source => 'Branch' } ); > my $patron_2 = $builder->build( { source => 'Borrower', value => { branchcode => $library_2->{branchcode}, categorycode => $patron_category->{categorycode} } } ); >- my $biblio = $builder->build( { source => 'Biblio' } ); >- my $biblioitem = $builder->build( { source => 'Biblioitem', value => { biblionumber => $biblio->{biblionumber} } } ); >- my $item = $builder->build( >+ my $biblio = $builder->build_sample_biblio({branchcode => $library->{branchcode}}); >+ my $item = $builder->build_sample_item( > { >- source => 'Item', >+ class => 'Koha::Items', > value => { >- homebranch => $library_1->{branchcode}, >- holdingbranch => $library_1->{branchcode}, >- notforloan => 0, >- itemlost => 0, >- withdrawn => 0, >- biblionumber => $biblioitem->{biblionumber}, >+ biblionumber => $biblio->biblionumber, >+ library => $library_1->{branchcode}, > } > } > ); > > set_userenv( $library_2 ); > my $reserve_id = AddReserve( >- $library_2->{branchcode}, $patron_2->{borrowernumber}, $biblioitem->{biblionumber}, '', 1, undef, undef, '', undef, $item->{itemnumber}, >+ $library_2->{branchcode}, $patron_2->{borrowernumber}, $item->biblionumber, '', 1, undef, undef, '', undef, $item->itemnumber, > ); > > #Return book and add transfer > set_userenv( $library_1 ); > my $do_transfer = 1; >- my ( $res, $rr ) = AddReturn( $item->{barcode}, $library_1->{branchcode} ); >- ModReserveAffect( $item->{itemnumber}, undef, $do_transfer, $reserve_id ); >- C4::Circulation::transferbook( $library_2->{branchcode}, $item->{barcode} ); >+ my ( $res, $rr ) = AddReturn( $item->barcode, $library_1->{branchcode} ); >+ ModReserveAffect( $item->itemnumber, undef, $do_transfer, $reserve_id ); >+ C4::Circulation::transferbook( $library_2->{branchcode}, $item->barcode ); > my $hold = Koha::Holds->find( $reserve_id ); > is( $hold->found, 'T', 'Hold is in transit' ); > > #Check transfer exists and the items holding branch is the transfer destination branch before marking it as lost >- my ($datesent,$frombranch,$tobranch) = GetTransfers($item->{itemnumber}); >+ my ($datesent,$frombranch,$tobranch) = GetTransfers($item->itemnumber); > is( $tobranch, $library_2->{branchcode}, 'The transfer record exists in the branchtransfers table'); >- my $itemcheck = Koha::Items->find($item->{itemnumber}); >+ my $itemcheck = Koha::Items->find($item->itemnumber); > is( $itemcheck->holdingbranch, $library_2->{branchcode}, 'Items holding branch is the transfers destination branch before it is marked as lost' ); > > #Simulate item being marked as lost and confirm the transfer is deleted and the items holding branch is the transfers source branch >- ModItem( { itemlost => 1 }, $biblio->{biblionumber}, $item->{itemnumber} ); >- LostItem( $item->{itemnumber}, 'test', 1 ); >- ($datesent,$frombranch,$tobranch) = GetTransfers($item->{itemnumber}); >+ ModItem( { itemlost => 1 }, $item->biblionumber, $item->itemnumber ); >+ LostItem( $item->itemnumber, 'test', 1 ); >+ ($datesent,$frombranch,$tobranch) = GetTransfers($item->itemnumber); > is( $tobranch, undef, 'The transfer on the lost item has been deleted as the LostItemCancelOutstandingTransfer is enabled'); >- $itemcheck = Koha::Items->find($item->{itemnumber}); >+ $itemcheck = Koha::Items->find($item->itemnumber); > is( $itemcheck->holdingbranch, $library_1->{branchcode}, 'Lost item with cancelled hold has holding branch equallying the transfers source branch' ); > }; > >-- >2.11.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 21985
:
83254
|
86634
|
86635
|
93259
| 93260 |
93261