Bugzilla – Attachment 169490 Details for
Bug 37448
Add build_sample_ill_request to TestBuilder.pm
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 37448: Add build_sample_ill_request
Bug-37448-Add-buildsampleillrequest.patch (text/plain), 2.29 KB, created by
Pedro Amorim
on 2024-07-24 13:49:13 UTC
(
hide
)
Description:
Bug 37448: Add build_sample_ill_request
Filename:
MIME Type:
Creator:
Pedro Amorim
Created:
2024-07-24 13:49:13 UTC
Size:
2.29 KB
patch
obsolete
>From 5b8b4a321e4d54ef63e9275252e43d01beec581d Mon Sep 17 00:00:00 2001 >From: Pedro Amorim <pedro.amorim@ptfs-europe.com> >Date: Wed, 24 Jul 2024 13:45:05 +0000 >Subject: [PATCH] Bug 37448: Add build_sample_ill_request > >The linked biblio_id of a generated test ILL request needs to be created by build_sample_biblio->AddBiblio. >Or else the related biblio is created by just 'build' and is not indexed + its related metadata is missing. > >To test: >1) Enabling ILL and installing FreeForm by running: > bash <(curl -s https://raw.githubusercontent.com/ammopt/koha-ill-dev/master/start-ill-dev.sh) >2) Run the script for ILL requests: > misc/devel/create_test_data.pl -n 5 -s Illrequest -d backend=FreeForm >3) Visit the ILLModule: > http://<intra_url>/cgi-bin/koha/ill/ill-requests.pl >4) Notice it loads 5 test ILL requests correctly > >Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com> >--- > misc/devel/create_test_data.pl | 2 ++ > t/lib/TestBuilder.pm | 15 +++++++++++++++ > 2 files changed, 17 insertions(+) > >diff --git a/misc/devel/create_test_data.pl b/misc/devel/create_test_data.pl >index 6447ca0b25..17202acced 100755 >--- a/misc/devel/create_test_data.pl >+++ b/misc/devel/create_test_data.pl >@@ -49,6 +49,8 @@ for ( 1 .. $number ) { > $builder->build_sample_biblio( $values ) > }elsif($source eq 'Item'){ > $builder->build_sample_item( $values ) >+ }elsif($source eq 'Illrequest'){ >+ $builder->build_sample_ill_request( $values ) > }else{ > $builder->build( > { >diff --git a/t/lib/TestBuilder.pm b/t/lib/TestBuilder.pm >index 57506b11d7..f7779ba031 100644 >--- a/t/lib/TestBuilder.pm >+++ b/t/lib/TestBuilder.pm >@@ -210,6 +210,21 @@ sub build_sample_item { > )->store->get_from_storage; > } > >+sub build_sample_ill_request { >+ my ( $self, $args ) = @_; >+ >+ $args->{biblio_id} = $args->{biblio_id} || $self->build_sample_biblio->biblionumber; >+ $args->{backend} = $args->{backend} || 'FreeForm'; >+ $args->{branchcode} = $args->{branchcode} || $self->build_object( { class => 'Koha::Libraries' } )->branchcode; >+ >+ return $self->build( >+ { >+ source => 'Illrequest', >+ value => $args, >+ } >+ ); >+} >+ > # ------------------------------------------------------------------------------ > # Internal helper routines > >-- >2.39.2
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 37448
:
169472
|
169474
|
169486
|
169487
|
169488
|
169489
|
169490
|
169550
|
169551
|
169552
|
169553
|
174526
|
174528
|
174834
|
174835