Bugzilla – Attachment 66947 Details for
Bug 19116
Holds not set to waiting when "Confirm" is used
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 19116: Add tests
Bug-19116-Add-tests.patch (text/plain), 2.73 KB, created by
Jonathan Druart
on 2017-09-07 16:20:07 UTC
(
hide
)
Description:
Bug 19116: Add tests
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2017-09-07 16:20:07 UTC
Size:
2.73 KB
patch
obsolete
>From 452194b2809b5f70085c169fa6f378fb794c8c1f Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Mon, 4 Sep 2017 14:14:31 -0300 >Subject: [PATCH] Bug 19116: Add tests > >--- > t/db_dependent/Circulation.t | 49 +++++++++++++++++++++++++++++++++++++++++++- > 1 file changed, 48 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Circulation.t b/t/db_dependent/Circulation.t >index 3e815768b0..08bb2fdb4d 100755 >--- a/t/db_dependent/Circulation.t >+++ b/t/db_dependent/Circulation.t >@@ -17,7 +17,7 @@ > > use Modern::Perl; > >-use Test::More tests => 100; >+use Test::More tests => 101; > > use DateTime; > >@@ -1729,6 +1729,53 @@ subtest 'AddReturn | is_overdue' => sub { > > }; > >+subtest 'Set waiting flag' => sub { >+ plan tests => 2; >+ >+ my $library_1 = $builder->build( { source => 'Branch' } ); >+ my $patron_1 = $builder->build( { source => 'Borrower', value => { branchcode => $library_1->{branchcode} } } ); >+ my $library_2 = $builder->build( { source => 'Branch' } ); >+ my $patron_2 = $builder->build( { source => 'Borrower', value => { branchcode => $library_2->{branchcode} } } ); >+ >+ my $biblio = $builder->build( { source => 'Biblio' } ); >+ my $biblioitem = $builder->build( { source => 'Biblioitem', value => { biblionumber => $biblio->{biblionumber} } } ); >+ my $item = $builder->build( >+ { >+ source => 'Item', >+ value => { >+ homebranch => $library_1->{branchcode}, >+ holdingbranch => $library_1->{branchcode}, >+ notforloan => 0, >+ itemlost => 0, >+ withdrawn => 0, >+ biblionumber => $biblioitem->{biblionumber}, >+ } >+ } >+ ); >+ >+ >+ >+ set_userenv( $library_2 ); >+ my $reserve_id = AddReserve( >+ $library_2->{branchcode}, $patron_2->{borrowernumber}, $biblioitem->{biblionumber}, >+ '', 1, undef, undef, '', undef, $item->{itemnumber}, >+ ); >+ >+ 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 ); >+ my $hold = Koha::Holds->find( $reserve_id ); >+ is( $hold->found, 'T', 'Hold is in transit' ); >+ >+ set_userenv( $library_2 ); >+ $do_transfer = 0; >+ AddReturn( $item->{barcode}, $library_2->{branchcode} ); >+ ModReserveAffect( $item->{itemnumber}, undef, $do_transfer, $reserve_id ); >+ $hold = Koha::Holds->find( $reserve_id ); >+ is( $hold->found, 'W', 'Hold is waiting' ); >+}; >+ > sub set_userenv { > my ( $library ) = @_; > C4::Context->set_userenv(0,0,0,'firstname','surname', $library->{branchcode}, $library->{branchname}, '', '', ''); >-- >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 19116
:
66307
|
66511
|
66824
|
66947
|
67079
|
67080
|
67306
|
67307
|
67308
|
67309
|
67310
|
67409
|
67410
|
67411