Bugzilla – Attachment 166000 Details for
Bug 36120
Add pickup locations to bookings
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 36120: (QA follow-up) Fix /biblios.t unit test
Bug-36120-QA-follow-up-Fix-bibliost-unit-test.patch (text/plain), 2.38 KB, created by
Martin Renvoize (ashimema)
on 2024-05-01 15:04:09 UTC
(
hide
)
Description:
Bug 36120: (QA follow-up) Fix /biblios.t unit test
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2024-05-01 15:04:09 UTC
Size:
2.38 KB
patch
obsolete
>From dd9e59cb40dfa30c75a7754658bba49e08411599 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Mon, 29 Apr 2024 15:53:01 +0100 >Subject: [PATCH] Bug 36120: (QA follow-up) Fix /biblios.t unit test > >This patch adds some mock data for pickup_items getting included in the >pickup locations response. > >Signed-off-by: Nick Clemens <nick@bywatersolutions.com> >--- > Koha/REST/V1/Biblios.pm | 11 ++++++++++- > t/db_dependent/api/v1/biblios.t | 5 +++++ > 2 files changed, 15 insertions(+), 1 deletion(-) > >diff --git a/Koha/REST/V1/Biblios.pm b/Koha/REST/V1/Biblios.pm >index 44aabc9d291..1c15e8ec25b 100644 >--- a/Koha/REST/V1/Biblios.pm >+++ b/Koha/REST/V1/Biblios.pm >@@ -530,7 +530,16 @@ sub pickup_locations { > my $pickup_locations = $c->objects->search($pl_set); > @response = map { $_->{needs_override} = Mojo::JSON->false; $_; } @{$pickup_locations}; > } >- @response = map { $_->{pickup_items} = $pl_set->{_pickup_location_items}->{ $_->{library_id} }; $_; } @response; >+ @response = map { >+ if ( exists $pl_set->{_pickup_location_items}->{ $_->{library_id} } >+ && ref $pl_set->{_pickup_location_items}->{ $_->{library_id} } eq 'ARRAY' ) >+ { >+ $_->{pickup_items} = $pl_set->{_pickup_location_items}->{ $_->{library_id} }; >+ } else { >+ $_->{pickup_items} = []; >+ } >+ $_; >+ } @response; > > return $c->render( > status => 200, >diff --git a/t/db_dependent/api/v1/biblios.t b/t/db_dependent/api/v1/biblios.t >index a5d0f66dcba..c10bae833e4 100755 >--- a/t/db_dependent/api/v1/biblios.t >+++ b/t/db_dependent/api/v1/biblios.t >@@ -475,6 +475,10 @@ subtest 'pickup_locations() tests' => sub { > $library_2_api->{needs_override} = Mojo::JSON->false; > $library_3_api->{needs_override} = Mojo::JSON->true; > >+ $library_1_api->{pickup_items} = []; >+ $library_2_api->{pickup_items} = []; >+ $library_3_api->{pickup_items} = []; >+ > my $patron = $builder->build_object( > { > class => 'Koha::Patrons', >@@ -540,6 +544,7 @@ subtest 'pickup_locations() tests' => sub { > > my $library_5_api = $library_5->to_api(); > $library_5_api->{needs_override} = Mojo::JSON->true; >+ $library_5_api->{pickup_items} = []; > > $t->get_ok( "//$userid:$password@/api/v1/biblios/" > . $biblio->id >-- >2.44.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 36120
:
162911
|
162912
|
162914
|
162915
|
162916
|
162917
|
162918
|
162919
|
162920
|
162921
|
162922
|
162923
|
162924
|
162925
|
162926
|
162927
|
162928
|
162976
|
163218
|
163219
|
163220
|
163221
|
163222
|
163223
|
163224
|
163435
|
163436
|
163437
|
163438
|
163439
|
163440
|
163441
|
163442
|
163443
|
163444
|
163445
|
163446
|
163447
|
163448
|
163565
|
163566
|
163567
|
163568
|
163569
|
163570
|
163571
|
163603
|
163604
|
163605
|
163606
|
163607
|
163608
|
163609
|
163610
|
163611
|
163612
|
163613
|
163635
|
163636
|
165140
|
165175
|
165176
|
165177
|
165178
|
165179
|
165180
|
165181
|
165182
|
165183
|
165184
|
165185
|
165186
|
165187
|
165188
|
165214
|
165215
|
165216
|
165419
|
165420
|
165421
|
165422
|
165423
|
165424
|
165425
|
165426
|
165427
|
165428
|
165429
|
165430
|
165431
|
165432
|
165433
|
165434
|
165435
|
165984
|
165985
|
165986
|
165987
|
165988
|
165989
|
165990
|
165991
|
165992
|
165993
|
165994
|
165995
|
165996
|
165997
|
165998
|
165999
| 166000 |
166001
|
166002