Bugzilla – Attachment 169919 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.36 KB, created by
Hammat wele
on 2024-07-31 21:29:54 UTC
(
hide
)
Description:
Bug 35434: (follow-up) Unit test
Filename:
MIME Type:
Creator:
Hammat wele
Created:
2024-07-31 21:29:54 UTC
Size:
2.36 KB
patch
obsolete
>From d1e04245063173ccb8aa6ce3983c758ae675832f 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 > >--- > 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 9e3824842a..e43e5bf946 100755 >--- a/t/db_dependent/Koha/Item.t >+++ b/t/db_dependent/Koha/Item.t >@@ -539,8 +539,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; >@@ -842,6 +843,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