Bugzilla – Attachment 174932 Details for
Bug 38505
CirculateILL checkout broken if existing biblio's item does not have a barcode
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 38505: CirculateILL: Add ILL::Request::check_out regression tests
Bug-38505-CirculateILL-Add-ILLRequestcheckout-regr.patch (text/plain), 3.66 KB, created by
Pedro Amorim
on 2024-11-22 13:50:45 UTC
(
hide
)
Description:
Bug 38505: CirculateILL: Add ILL::Request::check_out regression tests
Filename:
MIME Type:
Creator:
Pedro Amorim
Created:
2024-11-22 13:50:45 UTC
Size:
3.66 KB
patch
obsolete
>From c4c9ff48c43d926f21ce6af594f3fde08d003193 Mon Sep 17 00:00:00 2001 >From: Pedro Amorim <pedro.amorim@ptfs-europe.com> >Date: Thu, 21 Nov 2024 14:23:55 -0100 >Subject: [PATCH] Bug 38505: CirculateILL: Add ILL::Request::check_out > regression tests > >prove t/db_dependent/Koha/ILL/Requests.t > >Signed-off-by: R <r.delahunty@arts.ac.uk> >--- > t/db_dependent/Koha/ILL/Requests.t | 71 +++++++++++++++++++++++++++++- > 1 file changed, 70 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Koha/ILL/Requests.t b/t/db_dependent/Koha/ILL/Requests.t >index 464e5ce505..c4a536f01a 100755 >--- a/t/db_dependent/Koha/ILL/Requests.t >+++ b/t/db_dependent/Koha/ILL/Requests.t >@@ -1572,7 +1572,7 @@ subtest 'Custom statuses' => sub { > > subtest 'Checking in hook' => sub { > >- plan tests => 2; >+ plan tests => 6; > > $schema->storage->txn_begin; > >@@ -1626,6 +1626,75 @@ subtest 'Checking in hook' => sub { > $illrq->discard_changes; > is( $illrq->status, 'RET' ); > >+ my $request_for_checkout_out = $builder->build_sample_ill_request(); >+ $builder->build( >+ { >+ source => 'Illrequestattribute', >+ value => { illrequest_id => $request_for_checkout_out->illrequest_id, type => 'type', value => 'book' } >+ } >+ ); >+ >+ my $newly_created_biblio = Koha::Biblios->find( { biblionumber => $request_for_checkout_out->biblio_id } ); >+ is( $newly_created_biblio->items->count, 0, 'Biblio created without items' ); >+ >+ my $itemtype = $builder->build_object( >+ { >+ class => 'Koha::ItemTypes', >+ value => { >+ notforloan => 0, >+ rentalcharge => 0, >+ rentalcharge_daily => 1, >+ rentalcharge_daily_calendar => 0 >+ } >+ } >+ )->store; >+ >+ my $check_out = $request_for_checkout_out->check_out( >+ { >+ 'branchcode' => $request_for_checkout_out->branchcode, >+ 'item_type' => $itemtype->itemtype, >+ 'illrequest_id' => $request_for_checkout_out->illrequest_id, >+ 'stage' => 'form', >+ } >+ ); >+ >+ is( $newly_created_biblio->items->count, 1, 'A new item was created after checking out' ); >+ is( $check_out->{value}->{errors}, undef, 'No errors. Check-out was successful' ); >+ >+ # Test if biblio already has an item with no barcode >+ >+ my $another_checkout_out_request = $builder->build_sample_ill_request(); >+ $builder->build( >+ { >+ source => 'Illrequestattribute', >+ value => { illrequest_id => $another_checkout_out_request->illrequest_id, type => 'type', value => 'book' } >+ } >+ ); >+ my $another_newly_created_biblio = >+ Koha::Biblios->find( { biblionumber => $another_checkout_out_request->biblio_id } ); >+ >+ Koha::Item->new( >+ { >+ biblionumber => $another_newly_created_biblio->biblionumber, >+ homebranch => $another_checkout_out_request->branchcode, >+ holdingbranch => $another_checkout_out_request->branchcode, >+ barcode => '' >+ } >+ )->store; >+ >+ my $another_check_out = $another_checkout_out_request->check_out( >+ { >+ 'branchcode' => $another_checkout_out_request->branchcode, >+ 'item_type' => $itemtype->itemtype, >+ 'illrequest_id' => $another_checkout_out_request->illrequest_id, >+ 'stage' => 'form', >+ } >+ ); >+ is( >+ $another_check_out->{value}->{check_out_errors}->{error}->{UNKNOWN_BARCODE}, 1, >+ 'Barcode related error is set because existing item does not have a barcode' >+ ); >+ > $schema->storage->txn_rollback; > }; > >-- >2.39.5
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 38505
:
174892
|
174893
|
174894
|
174895
|
174896
|
174924
|
174928
|
174929
|
174930
|
174931
| 174932