Bugzilla – Attachment 178298 Details for
Bug 35434
Non-superlibrarians should not place holds in other libraries when IndependentBranches is enabled
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 35434: (follow-up) Unit test
Bug-35434-follow-up-Unit-test.patch (text/plain), 2.48 KB, created by
Hammat wele
on 2025-02-18 17:51:07 UTC
(
hide
)
Description:
Bug 35434: (follow-up) Unit test
Filename:
MIME Type:
Creator:
Hammat wele
Created:
2025-02-18 17:51:07 UTC
Size:
2.48 KB
patch
obsolete
>From 582d5d812b36c18d9f7b2dc4905909b0cd3b3efd Mon Sep 17 00:00:00 2001 >From: Hammat Wele <hammat.wele@inlibro.com> >Date: Wed, 31 Jul 2024 21:29:16 +0000 >Subject: [PATCH] Bug 35434: (follow-up) Unit test > >Test plan: >1. Tests should pass: prove t/db_dependent/Koha/Item.t > >Signed-off-by: David Nind <david@davidnind.com> >--- > t/db_dependent/Koha/Item.t | 36 +++++++++++++++++++++++++++++++++++- > 1 file changed, 35 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Koha/Item.t b/t/db_dependent/Koha/Item.t >index bd3f43b5dc..76593b147e 100755 >--- a/t/db_dependent/Koha/Item.t >+++ b/t/db_dependent/Koha/Item.t >@@ -561,8 +561,9 @@ subtest "as_marc_field() tests" => sub { > > subtest 'pickup_locations() tests' => sub { > >- plan tests => 68; >+ plan tests => 70; > >+ t::lib::Mocks::mock_preference('canreservefromotherbranches', 1); > $schema->storage->txn_begin; > > my $dbh = C4::Context->dbh; >@@ -883,6 +884,39 @@ subtest 'pickup_locations() tests' => sub { > > t::lib::Mocks::mock_preference( 'UseBranchTransferLimits', 0 ); > >+ t::lib::Mocks::mock_preference( 'IndependentBranches', 1 ); >+ t::lib::Mocks::mock_preference( 'canreservefromotherbranches', 0 ); >+ t::lib::Mocks::mock_userenv( { branchcode => $library4->branchcode } ); >+ >+ my $item4 = $builder->build_sample_item( >+ { >+ homebranch => $library4->branchcode, >+ holdingbranch => $library4->branchcode >+ } >+ )->store; >+ my $patron5 = $builder->build_object( >+ { class => 'Koha::Patrons', value => { branchcode => $library4->branchcode, firstname => '5', flags => 84 } } ); >+ >+ @pickup_locations = map { >+ my $pickup_location = $_; >+ grep { $pickup_location->branchcode eq $_ } @branchcodes >+ } $item4->pickup_locations( { patron => $patron5 } )->as_list; >+ ok( >+ scalar(@pickup_locations) == 1 && @pickup_locations[0] eq $library4->branchcode, >+ 'There should be only one branch in the pickup locations, the connected branch' >+ ); >+ >+ t::lib::Mocks::mock_userenv( { branchcode => $library2->branchcode } ); >+ >+ @pickup_locations = map { >+ my $pickup_location = $_; >+ grep { $pickup_location->branchcode eq $_ } @branchcodes >+ } $item4->pickup_locations( { patron => $patron5 } )->as_list; >+ ok( >+ scalar(@pickup_locations) == 0, >+ 'The pickup locations should be empty if the user connected branch is not the same as the item home branch' >+ ); >+ > $schema->storage->txn_rollback; > }; > >-- >2.34.1
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 35434
:
159346
|
161509
|
166648
|
169917
|
169918
|
169919
|
176045
|
176046
|
176047
|
178296
|
178297
| 178298