Bugzilla – Attachment 129130 Details for
Bug 29806
->pickup_locations should always be called in scalar context
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 29806: Regression tests
Bug-29806-Regression-tests.patch (text/plain), 1.52 KB, created by
David Nind
on 2022-01-07 07:48:59 UTC
(
hide
)
Description:
Bug 29806: Regression tests
Filename:
MIME Type:
Creator:
David Nind
Created:
2022-01-07 07:48:59 UTC
Size:
1.52 KB
patch
obsolete
>From 004c63ead26656a5bbc37a50971c99b3c5342497 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Thu, 6 Jan 2022 09:27:28 -0300 >Subject: [PATCH] Bug 29806: Regression tests > >Signed-off-by: David Nind <david@davidnind.com> >--- > t/db_dependent/api/v1/holds.t | 20 +++++++++++++++++++- > 1 file changed, 19 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/api/v1/holds.t b/t/db_dependent/api/v1/holds.t >index 006c61659a..abf23d4fca 100755 >--- a/t/db_dependent/api/v1/holds.t >+++ b/t/db_dependent/api/v1/holds.t >@@ -1066,7 +1066,7 @@ subtest 'edit() tests' => sub { > > subtest 'add() tests' => sub { > >- plan tests => 10; >+ plan tests => 16; > > $schema->storage->txn_begin; > >@@ -1185,6 +1185,24 @@ subtest 'add() tests' => sub { > $t->post_ok( "//$userid:$password@/api/v1/holds" => json => $item_hold_data ) > ->status_is(201); > >+ # empty cases >+ $mock_biblio->mock( 'pickup_locations', sub { >+ return Koha::Libraries->new->empty; >+ }); >+ >+ $t->post_ok( "//$userid:$password@/api/v1/holds" => json => $biblio_hold_data ) >+ ->status_is(400) >+ ->json_is({ error => 'The supplied pickup location is not valid' }); >+ >+ # empty cases >+ $mock_item->mock( 'pickup_locations', sub { >+ return Koha::Libraries->new->empty; >+ }); >+ >+ $t->post_ok( "//$userid:$password@/api/v1/holds" => json => $item_hold_data ) >+ ->status_is(400) >+ ->json_is({ error => 'The supplied pickup location is not valid' }); >+ > $schema->storage->txn_rollback; > }; > >-- >2.30.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 29806
:
129058
|
129059
|
129060
|
129130
|
129131
|
129132
|
129183
|
129184
|
129185
|
129186