Bugzilla – Attachment 110889 Details for
Bug 24598
Hold not reset properly if checked out to another patron
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 24598: Add tests
Bug-24598-Add-tests.patch (text/plain), 2.97 KB, created by
Fridolin Somers
on 2020-09-29 08:17:17 UTC
(
hide
)
Description:
Bug 24598: Add tests
Filename:
MIME Type:
Creator:
Fridolin Somers
Created:
2020-09-29 08:17:17 UTC
Size:
2.97 KB
patch
obsolete
>From eac1473dd9236874ce77bcf5d375f4b281ea7ed7 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Mon, 10 Aug 2020 15:51:13 +0200 >Subject: [PATCH] Bug 24598: Add tests > >Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com> >--- > t/db_dependent/Circulation.t | 59 +++++++++++++++++++++++++++++++++++- > 1 file changed, 58 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Circulation.t b/t/db_dependent/Circulation.t >index 8ea7ac50eb..d9be24e4d7 100755 >--- a/t/db_dependent/Circulation.t >+++ b/t/db_dependent/Circulation.t >@@ -18,7 +18,7 @@ > use Modern::Perl; > use utf8; > >-use Test::More tests => 48; >+use Test::More tests => 49; > use Test::Exception; > use Test::MockModule; > use Test::Deep qw( cmp_deeply ); >@@ -4036,6 +4036,63 @@ subtest 'transferbook tests' => sub { > > }; > >+subtest 'Checkout should correctly terminate a transfer' => sub { >+ plan tests => 7; >+ >+ my $library_1 = $builder->build_object( { class => 'Koha::Libraries' } ); >+ my $patron_1 = $builder->build_object( >+ { >+ class => 'Koha::Patrons', >+ value => { branchcode => $library_1->branchcode } >+ } >+ ); >+ my $library_2 = $builder->build_object( { class => 'Koha::Libraries' } ); >+ my $patron_2 = $builder->build_object( >+ { >+ class => 'Koha::Patrons', >+ value => { branchcode => $library_2->branchcode } >+ } >+ ); >+ >+ my $item = $builder->build_sample_item( >+ { >+ library => $library_1->branchcode, >+ } >+ ); >+ >+ t::lib::Mocks::mock_userenv( { branchcode => $library_1->branchcode } ); >+ my $reserve_id = AddReserve( >+ { >+ branchcode => $library_2->branchcode, >+ borrowernumber => $patron_2->borrowernumber, >+ biblionumber => $item->biblionumber, >+ itemnumber => $item->itemnumber, >+ priority => 1, >+ } >+ ); >+ >+ my $do_transfer = 1; >+ ModItemTransfer( $item->itemnumber, $library_1->branchcode, >+ $library_2->branchcode ); >+ ModReserveAffect( $item->itemnumber, undef, $do_transfer, $reserve_id ); >+ GetOtherReserves( $item->itemnumber ) >+ ; # To put the Reason, it's what does returns.pl... >+ my $hold = Koha::Holds->find($reserve_id); >+ is( $hold->found, 'T', 'Hold is in transit' ); >+ my $transfer = $item->get_transfer; >+ is( $transfer->frombranch, $library_1->branchcode ); >+ is( $transfer->tobranch, $library_2->branchcode ); >+ is( $transfer->reason, 'Reserve' ); >+ >+ t::lib::Mocks::mock_userenv( { branchcode => $library_2->branchcode } ); >+ AddIssue( $patron_1->unblessed, $item->barcode ); >+ $transfer = $transfer->get_from_storage; >+ isnt( $transfer->datearrived, undef ); >+ $hold = $hold->get_from_storage; >+ is( $hold->found, undef, 'Hold is waiting' ); >+ is( $hold->priority, 1, ); >+}; >+ > $schema->storage->txn_rollback; > C4::Context->clear_syspref_cache(); > $branches = Koha::Libraries->search(); >-- >2.28.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 24598
:
108002
|
108003
|
110889
|
110890
|
111060
|
111061
|
111371