Bugzilla – Attachment 174835 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.13 KB, created by
Pedro Amorim
on 2024-11-20 10:57:35 UTC
(
hide
)
Description:
Bug 37448: Add build_sample_ill_request
Filename:
MIME Type:
Creator:
Pedro Amorim
Created:
2024-11-20 10:57:35 UTC
Size:
2.13 KB
patch
obsolete
>From 26988f0b4ed276b16d44b8bf1fdbf78c9af05357 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) Apply the [DONT PUSH] patch and enable ILLModule >2) Run the script for ILL requests: > misc/devel/create_test_data.pl -n 5 -s Illrequest -d backend=Standard >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> > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >--- > t/lib/TestBuilder.pm | 34 ++++++++++++++++++++++++++++++++++ > 1 file changed, 34 insertions(+) > >diff --git a/t/lib/TestBuilder.pm b/t/lib/TestBuilder.pm >index dc38cd5ae9..5aa1d0cdb7 100644 >--- a/t/lib/TestBuilder.pm >+++ b/t/lib/TestBuilder.pm >@@ -210,6 +210,40 @@ sub build_sample_item { > )->store->get_from_storage; > } > >+=pod >+ >+=head2 build_sample_ill_request >+ >+Builds a sample ILL request with the supplied arguments. >+ >+C<$args> is a hashref with the following optional keys: >+ >+=over 4 >+ >+=item * C<biblio_id> (default: a new sample biblio created with L<build_sample_biblio>) >+ >+=item * C<backend> (default: Standard) >+ >+=item * C<branchcode> (default: a random branch) >+ >+=back >+ >+=cut >+sub build_sample_ill_request { >+ my ( $self, $args ) = @_; >+ >+ $args->{biblio_id} = $args->{biblio_id} || $self->build_sample_biblio->biblionumber; >+ $args->{backend} = $args->{backend} || 'Standard'; >+ $args->{branchcode} = $args->{branchcode} || $self->build_object( { class => 'Koha::Libraries' } )->branchcode; >+ >+ return $self->build_object( >+ { >+ class => 'Koha::ILL::Requests', >+ value => $args, >+ } >+ )->store->get_from_storage; >+} >+ > # ------------------------------------------------------------------------------ > # Internal helper routines > >-- >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 37448
:
169472
|
169474
|
169486
|
169487
|
169488
|
169489
|
169490
|
169550
|
169551
|
169552
|
169553
|
174526
|
174528
|
174834
| 174835