Bugzilla – Attachment 117923 Details for
Bug 27895
Internal server error when trying to change pickup location for a hold with no valid locations
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 27895: Unit test
Bug-27895-Unit-test.patch (text/plain), 1.28 KB, created by
Nick Clemens
on 2021-03-08 14:27:37 UTC
(
hide
)
Description:
Bug 27895: Unit test
Filename:
MIME Type:
Creator:
Nick Clemens
Created:
2021-03-08 14:27:37 UTC
Size:
1.28 KB
patch
obsolete
>From c6802e70edcc85b79cac11cc9dae1b3fa7ac1f28 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Mon, 8 Mar 2021 14:27:20 +0000 >Subject: [PATCH] Bug 27895: Unit test > >--- > t/db_dependent/Koha/Hold.t | 8 +++++++- > 1 file changed, 7 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Koha/Hold.t b/t/db_dependent/Koha/Hold.t >index a6a5c4a7d6..ac3ef3ddd1 100755 >--- a/t/db_dependent/Koha/Hold.t >+++ b/t/db_dependent/Koha/Hold.t >@@ -143,7 +143,7 @@ subtest 'set_pickup_location() tests' => sub { > > subtest 'is_pickup_location_valid() tests' => sub { > >- plan tests => 4; >+ plan tests => 5; > > $schema->storage->txn_begin; > >@@ -196,5 +196,11 @@ subtest 'is_pickup_location_valid() tests' => sub { > ok( !$item_hold->is_pickup_location_valid({ library_id => $library_1->branchcode }), 'Pickup location invalid'); > ok( $item_hold->is_pickup_location_valid({ library_id => $library_2->id }), 'Pickup location valid' ); > >+ # let's mock what Koha::Item->pickup_locations returns, for testing >+ $mock_item->mock( 'pickup_locations', sub { >+ return Koha::Libraries->new()->empty; >+ }); >+ ok( !$item_hold->is_pickup_location_valid({ library_id => $library_2->id }), 'Pickup location invalid' ); >+ > $schema->storage->txn_rollback; > }; >-- >2.11.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 27895
: 117923 |
125781